I have the following code and I need to convert it to Angular Js..also I'd like to stop the user from entering a space only at the start (can't input space bar before any text)
<input type="text" name="firstname" runat="server" onkeypress="return AvoidSpace()">
function AvoidSpace() {
var x=document.forms["firs`enter code here`tname"].value;
if (event.keyCode == 32 ) {
event.returnValue = false;
return false;
}
}