KingKongFrog KingKongFrog - 9 months ago 131
AngularJS Question

angular restriction to not allow spaces in text field

I do not want a user to enter spaces in a text field. I don't want it on submit validation but rather - a space will not show up on the text field when they click it.

<input ng-model="field" ng-trim="false" ng-change="field = field.split(' ').join('')" type="text">