With the introduction of 1.3, Angular gives us more control over how and when to update ngModel values by using ngModelOptions. One great feature is debounce, effectively delaying updates from the view value to the model. However, when using debounce, you’re stuck with the default HTML events. So how to add your custom events? Let’s dive in!
TL;DR? Write your own directive that depends on ngModel and executes the following code if your scenario occurs:
Want to use a clear event with debounce for when a user clears a field? Install our directive.
With debounce, you can add a delay for updating the ngModel value. This delay resets after each change. If you choose your debounce value wisely, the update will happen only when the user stops editing the field, not on each single keystroke. …
Combining AngularJS and Parse introduces a few challenges. Here are two excellent posts to get you started. After that, I ran into bad performance when filtering a list of Parse objects with ngFilter. Let’s solve that.
First off, let’s have a look at a Parse object:
As you can see, it’s quite bulky. By default, ngFilter will match any property of an object. So, Angular looks at all properties and their inner properties, etc. This is clearly our performance breaker.
We want to tell Angular to not look at every property, for which ngFilter has support out of the box. However, in my case, I want to search multiple fields with an OR operator, having only one input field for the search. …
In Eclipse, I’m used to constantly moving code around with my keyboard. Two simple examples:
While using Xcode, I started to notice that not having these three shortcuts cut down my productivity significantly. …