What Is New in AngularJS 1.4 (summary table)
AngularJS 1.4 delivers a mix of new capabilities, performance refinements, and important bug fixes. This release focuses on making the framework more powerful and easier to work with for complex applications.
| Category | Key Changes |
|---|---|
| New Features | Animation hooks, enhanced ngMessages, ngAria improvements, component helper. |
| Core Improvements | Faster $compile, new $http transform hooks, smarter ngModel options parsing. |
| Bug Fixes | Numerous fixes across directives, services, and animation for edge-case stability. |
| Breaking Changes | Some ngAnimate and ngModel behavior changes; requires testing for upgrades. |
How did animation and accessibility get better?
The ngAnimate module received low-level hooks for more control. You can now use $animateCss to trigger custom CSS animations directly from JavaScript, giving you the power to sequence complex animations programmatically.
For accessibility, ngAria got smarter. It now automatically adds aria-checked for checkboxes and aria-disabled for elements with ngDisabled. This matters because it reduces boilerplate and makes apps more accessible by default without extra work from developers.
What core services were improved?
$compile got faster, especially for repeated compilation. In practice, this means templates with many bindings or repeated directives will see a performance boost during the initial bootstrap phase.
The $http service is more flexible. You can now specify a transformResponse function per request, not just globally. This is useful for APIs that return different data formats on different endpoints.
$http.get('/api/data', {
transformResponse: function(data) {
return myCustomParser(data);
}
});
Were there any new directives or helpers?
Yes, ngMessages got a major upgrade with ngMessageExp. This allows you to display messages based on dynamic expressions, not just static keys, making form validation feedback much more flexible and powerful.
A new .component() helper method was introduced as a precursor to the Angular 2 component model. It enforces a simpler, more isolated configuration than .directive(), promoting better architecture.
FAQ
What's the most practical benefit of the $animateCss hook?
It lets you trigger complex, multi-stage CSS animations from your controller or service logic. Before, you were more limited to toggling classes. Now you can orchestrate animations with precise timing.
Does the new ngMessageExp directive break my existing ngMessages code?
No, it's additive. Your existing ng-message directives will keep working. ngMessageExp is a new directive for when you need to evaluate an expression to decide which error to show.
Why should I use the .component() helper over .directive()?
It's simpler and more opinionated. .component() defaults to isolated scope, uses a controller, and binds to 'controllerAs'. This reduces configuration bugs and steers you towards a more testable, component-style architecture.
Are the $http per-request transforms a big deal?
They solve a specific pain point. If you had one API endpoint that returned XML and others that returned JSON, you previously needed messy workarounds. Now you can handle each endpoint cleanly.
What's the main breaking change I should test for?
Check your custom form controls using ngModel. The parsing and formatting pipeline behavior was tightened, which might affect how you handle $viewValue and $modelValue in edge cases.