BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Angular Releases Version 1.5, Narrows Focus

| by David Iffland Follow 3 Followers on Feb 09, 2016. Estimated reading time: 2 minutes |

The Angular team has released version 1.5, completing a major upgrade that brings 1.X developers closer to what they'll encounter in version 2.

In the announcement blog post, Pete Bacon Darwin says that the goal of this release was "to improve the upgrade path to Angular 2. In this release we have added features that will enable developers to write Angular 1 applications that are closer to the way that applications are structured in Angular 2."

The biggest move towards Angular 2 is the introduction of the new module.component(). This new helper aims to eliminate the need for developers to write directives in the traditional directive definition object style. Those familiar with Angular 2 will notice the similarity. From the post, here's an example of how to define a new component:

myModule.component('myComponent', {
  template: '<h1>Hello {{ $ctrl.getFullName() }}</h1>',
  bindings: { firstName: '<', lastName: '<' },
  controller: function() {
    this.getFullName = function() {
      return this.firstName + ' ' + this.lastName;
    };
  }
});

These new components can be used in some scenarios where developers previously would have created a directive or over-used a traditional controller. But, it's not a complete replacement for traditional directives. For example, components can't be used for DOM manipulation and all components have to be triggered with a custom HTML element; attribute directives are not supported. A component as defined above is used like this:

<my-component first-name="'Alan'" last-name="'Rickman'"></my-component>

The new component guide provides a more complete overview of the differences between classic directives and components.

  • One-way bindings
  • Lifecycle hooks
  • Binding to required directives
  • Multi-slot transclusion
  • Default transclusion content

Developers on version 1.4 can read the migration guide to see what changes are required as version 1.5 has breaking changes.

This is expected to be the biggest release for the foreseeable future. Asked by InfoQ about how 1.X will proceed, Bacon Darwin said:

We haven't started planning the next release cycle for Angular 1. Since we are getting close to the GA release of Angular 2, we do not expect to be developing Angular 1 in any way that doesn't move it closer to Angular 2. If breaking changes are required in order to achieve this then you can expect a 1.6 release. In the meantime we are continuing to work on Angular 1.5.x with bug fixes and minor features that do not diverge from the aim of making it easier to upgrade to Angular 2.

The new component router is expected to be released later this week.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

What a mess... Just use React. by Clinton Begin

The transition will be non-trivial and for little gain. I would recommend to anyone making the move to give serious consideration to React. My bet is that you can rewrite your app in React, faster and cleaner than you can port it to Angular 2 --or even continue to maintain it with Angular 1.x. IMHO...hth.

drop the use of "drop" by Ken Geis

Please mind your wording. The word "drop" can refer to abandoning something, and I think that usage is more common than "deliver" (at least outside of pop music.) From the headline, I expected this article to be about the opposite of what it actually was.

Re: drop the use of "drop" by David Iffland

Ken,

You're right about this. I've updated the title to avoid the ambiguity. Thanks.

Re: drop the use of "drop" by Greg Liebowitz

You must admit, "drop" made for an excellent click-bait headline. :)

Re: What a mess... Just use React. by Brendan Alexander

I don't have experience with React. I am sure it is great, and eventually I will try it. Since angular2.beta as come out I have done two production level web apps with it, and I find it is very easy to learn and implement. Performance is excellent, and I am now pitched toward the future of javascript, vis a vis components and Ecmascript 6 and beyond. Furthermore, I like the angular2 ecosystem, especially the use of Typescript, and only expect it to get better as it moves toward final release and beyond. Porting from Angular 1.x to 2 is well worth it in my opinion.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

5 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT