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:

ngModelCtrl.$setViewValue(element.val(), 'yourEvent');

Want to use a clear event with debounce for when a user clears a field? Install our directive.

What is debounce?

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.

Parse objects

First off, let’s have a look at a Parse object:

Image for post
Image for post
Quick glance 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.

Solution

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. …

Being used to IDEs like Eclipse, I feel kind of crippled when I’m using Xcode. Should I start using AppCode? Probably. But for now, some tips to make life a bit easier.

Custom Shortcuts

In Eclipse, I’m used to constantly moving code around with my keyboard. Two simple examples:

  • Alt + up/down: Move selected code up/down
  • Alt + Cmd + up/down: Copy selected code up/down
  • Cmd + d: Delete current line or selection

While using Xcode, I started to notice that not having these three shortcuts cut down my productivity significantly. …

About

Jasper Kuperus

Tech enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store