ngEurope: what's new in Angular 1.3?

Angular 1.3 provides us with some improvements over an already very decent framework. At ngEurope, the sessions were fast and intensive, which was an interesting approach, but also didn't allow for very many details. That being said, here are the points I noted.


This allows you to disable all the debugging info for the code you will deploy in production. Read more about it in the docs.


Normally, returning from an HTTP call will trigger Angular's $apply function. If you are doing several HTTP calls in succession, it might be interesting to only call the $apply function when they have finished. The useApplyAsync function gives you that possibility. Setting this to true will make Angular wait for HTTP calls that finish close together to finish, before calling $apply.

one-time binding (with ::)

Finally! One-time bindings allow you to make Angular forget about the binding once it has rendered it. This can improve performance, especially when you have a lot of bindings that no longer change once the result of the binding was rendered. Doing so is easy: just prefix your binding with '::', like so:


Now, Angular will no longer track changes to this property

ng-model-options="{debounce: 500}

This waits 500ms before updating the binding. This can be useful when the updating of your binding could take a while.

ng-model-options="{updateOn: 'blur'}

If you've used WPF, this is the equivalent of UpdateSourceTrigger. The updateOn option accepts any javascript event and does just that: it updates the model when the given event is raised.


The allOrNothing feature prevents Angular from making an HTTP request when it doesn't make any sense. For example this:


will not make an HTTP request if user or is undefined.

Finally, ngMessages allows for easier validation messages.

So that is what I learnt from the session about Angular 1.3. It's just a quick overview, but it's good to know what's possible. When you're facing a particular situation, and you know Angular has a solution for it, you won't feel the need to implement a solution yourself. You can just go check out the documentation.