The angular team recently released the official version of angular 1.5, which implemented a major upgrade that still uses 1. The X-version developer will be able to easily transition to angular 2 development.
"The purpose of this release is to" improve the angular 2 upgrade path, "Pete Bacon Darwin wrote in a blog post in the statement. We've introduced some new features in this release, so developers are writing a angular 1 application that is closer to the architecture applied in angular 2. ”
In this release, the new Module.component () helper method is the maximum change to transition to angular 2. By using this method, developers will no longer have to follow the traditional directive definition object style to write directive. If the reader is already familiar with the angular 2, this similarity should be noted. In this article, the author shows a way to define a new component through an example:
Mymodule.component (' MyComponent ', {
Template: '
Prior to the advent of component, developers often used only directive, or were able to implement certain scenarios through unconventional use of controller. This is not to say that component will completely replace directive, for example, component cannot be used to manipulate the DOM, and that all component must be activated through custom HTML elements, rather than through the element's attribute triggering. Component defined in the above manner can be used in the following code:
<my-component first-name= "' Alan '" last-name= "' Rickman '" ></my-component>
The new Component Guide provides a more complete explanation of the differences between traditional directive and component.
One-way binding
Life cycle Hooks
Bind to required directive
Support for multiple slot transclusion
Default transclusion content
Currently, the 1.4-version developer can read the migration Guide to see what changes need to be made when migrating, because some disruptive changes have been introduced in version 1.5.
For a foreseeable period of time, the 1.5 version should be the biggest change ever. When Infoq asked Bacon Darwin how the 1.X version would go, he replied:
We have not yet started planning the next release cycle for angular 1. Since the date of the official release of Angular 2 is getting closer, if we continue to develop angular 1, we will try to make it closer to angular 2. If you have to introduce disruptive changes to achieve this, you can expect the 1.6 version to occur. At the same time, we will continue the development of the angular 1.5.x version, providing bug fixes and some minor features. In short, this is not in conflict with our goal of making angular 1.X easier to migrate to angular 2.
The new component router feature should be released later this week. Interested friends please pay attention to cloud Habitat community website!