Before accepting into added altercation about Angular 2.0 (which has an
estimated absolution date of the end of 2015), let’s briefly accede the
aesthetics abaft the new version. Angular 2.0 development was started to
abode the afterward concerns:
Mobile
The new Angular adaptation will be focused on the development of
adaptable apps. The account is that it’s easier to handle the desktop
aspect of things, already the challenges accompanying to adaptable
(performance, amount time, etc.) accept been addressed.
Various modules will be removed from Angular’s core, consistent in
bigger performance. These will acquisition their way into Angular’s
ever-growing ecosystem of modules, acceptation you’ll be able to aces
and accept the locations you need.
Modern
Angular 2.0 will ambition ES6 and “evergreen” avant-garde browsers
(those automatically adapted to the latest version). Building for these
browsers agency that assorted hacks and workarounds that accomplish
Angular harder to advance can be alone acceptance developers to focus on
the cipher accompanying to their business domain.
What’s the Controversy?
During the ng-conference there was no acknowledgment of a clearing aisle
to adaptation 2.0. It was aswell acicular out that the jump to 2.0
adaptation will advance to torn Angular 1.3 apps, as there won’t be any
backwards compatibility. Since then, the developer association has been
abuzz with ambiguity and speculation, with some developers analytic if
it’s even account starting a new Angular 1.3 project.
What Are the Changes?
AtScript
AtScript is a superset of ES6 and it’s getting acclimated to advance
Angular 2.0. It’s candy by the Traceur compiler (along with ES6) to
aftermath ES5 cipher and uses TypeScript’s blazon syntax to accomplish
runtime blazon assertions instead of abridge time checks. However,
AtScript isn’t compulsory—you will still be able to use credible
JavaScript/ES5 cipher instead of AtScript to abode Angular apps.
Improved Dependency Bang (DI)
Dependency bang (a software architectonics arrangement in which an
article is anesthetized its dependencies, rather than creating them
itself) was one of the factors that initially differentiated Angular
from its competitors. It is decidedly benign in agreement of modular
development and basal isolation, yet its accomplishing was bedeviled
with problems in Angular 1.x. Angular 2.0 will will abode these issues,
as able-bodied as abacus missing appearance such as adolescent injectors
and lifetime/scope control.
Annotations
AtScript provides accoutrement for advertence metadata with functions.
This facilitates the architectonics of article instances by accouterment
the appropriate advice to the DI library (which will analysis for
associated metadata if calling a action or creating an instance of a
class). It will be aswell simple to override constant abstracts by
bartering an Inject annotation.
Child Injectors
A adolescent injector inherits all the casework of its ancestor with the
adequacy of cardinal them at the adolescent level. According to
requirement, altered types of altar can be alleged out and automatically
overridden in assorted scopes.
Instance Scope
The bigger DI library will affection instance ambit control, which will
become even added able if acclimated with adolescent injectors and your
own ambit identifiers.
Templating and Abstracts Binding
Let’s yield a attending at templating and abstracts bounden as they go duke in duke if developing apps.
Dynamic Loading
This is a affection which is missing from the accepted adaptation of
Angular. It will be addressed by Angular 2.0, which will let developers
add new directives or controllers on the fly.
Templating
In Angular 2.0, the arrangement accumulation action will be
asynchronous. As the cipher is based on the ES6 bore spec, the bore
loader will amount dependencies by artlessly referencing them in the
basal definition.
Directives
In Angular 2.0 there will be three kinds of directives:
Basal Directives – These will actualize reusable apparatus by
encapsulating argumentation in JavaScript, HTML or an alternative CSS
appearance sheet.
Decorator Directives – These directives will
be acclimated to adorn elements (for archetype abacus a tooltip, or
showing/hiding elements appliance ng-show/ng-hide).
Arrangement Directives – These will about-face HTML into a reusable
template. The instantiating of the arrangement and its admittance into
the DOM can be absolutely controlled by the charge author. Examples
cover ng-if and ng-repeat.
Comments
Post a Comment