Closed shuhei closed 8 years ago
Why remove @Query?
@JonnyBGod Because the parameter decorator syntax cannot be parsed by Babel. This plugin used to monkey-patch the Babel's parser but the newer version of Babel has forbidden monkey-patching on its parser.
By the way, you'll be able to achieve similar things as @Query
by @ContentChildren
.
The babel team is going to forbid people from monkey-patching the parser.
https://github.com/babel/babel/pull/3204
Parameter decorators used in Angular 2
DI for directives
@Attribute
: Not so necessary? Can we use@Input
instead of this?@Query
: Replaceable with@ContentChild
and@ContentChildren
?@ViewQuery
: Replaceable with@ViewChild
and@ContentChildren
?@Host
: The host directive's providers http://victorsavkin.com/post/126514197956/dependency-injection-in-angular-1-and-angular-2Pure DI
@Inject
: Probably be necessary for advanced developers?@Optional
: Probably necessary for advanced developers?@Self
: Not so necessary for app developers? The same element's providers http://victorsavkin.com/post/126514197956/dependency-injection-in-angular-1-and-angular-2@SkipSelf
: Not so necessary for app developers?https://angular.io/docs/ts/latest/api/#!?apiFilter=metadata