![]() parsers change how view values will be saved in the modelĬoming back to our requirements, let’s assume we have a template which could look as per following:.formatters change how model values will appear in the view.We could approuch the first scenario with mix on ng-minlength & ng-maxlength, but for other two there are no such build-in AngularJS methods.įirst of all we need to distinguish the different between $parsers & $formaters, both of which are available on our ngModelController. Let’s assume we have a following requirement for our input, furthermore, we want our error messages to be usable/accessible with the new ng-messages: ![]() The following is a quick & dirty intro to how to create a custom $parser and add it to the ngModelController, which in more human translation could mean for example, adding a custom validator to the ng-model of the input.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |