Currently browsing

January 2015

Listening to ngModel in a directive

It took a bit of searching until I found the solution to how one can listen to ng-model changes in a directive with isolate scope. The suggestive solution would be to add a listener to the $viewChangeListeners property of the ngModel controller. But this isn’t failsafe, it seems; the listeners …

Custom form elements in Angular

Angular’s magic shines mightily when it comes to HTML forms, as it greatly simplifies form validation etc. But what if you would like to use a custom form element, such as datepicker using a jQuery UI plugin? Amazingly, Angular’s magic makes this quite easy – if your form element has …