Should we stop using @View annotation and use @Component only in Angular 2 components?

All @View annotation properties @View also present in @Component . Previously, both used the examples, but from the beta version (and possibly earlier) the code samples on the angular.io website use only @Component . Is this the preferred way to create components?

+6
source share
2 answers

Update

@View() is about to be deleted https://github.com/angular/angular/pull/7495


Not sure if @View will be supported. They discussed its elimination. As far as I know, they are still planning to add support for multiple views, but have not yet decided what the approach will look like.

See also https://github.com/angular/angular/issues/7363

+3
source

I am sure that the @View decorator will be removed. You can use the template key in the @Component decorator to specify a presentation template. Also, when you look for @View in documents, you can see that the example does not match what is written https://angular.io/docs/ts/latest/api/core/View-decorator.html

It is very important for me that it will be deleted.

+3
source

All Articles