-1

All:

I am pretty new to Angular2, from some examples, I find that there could be a @Component along with @View, while in others, there is only @Component and the properties(such as template, directives etcs) inside @View will be merged into @Component.

I am not sure if my understanding is right: Is @Component can include @View? If so, why we need a separated @View annotation?

Thanks

Kuan
  • 11,149
  • 23
  • 93
  • 201

1 Answers1

-1

update

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


It was considered to support multiple views. If you only have one view using @Component() alone or @Component() and @View() is entirely the same. It's not sure if the @View() annotation will stay or if they will choose another strategy to implement multiple views.

See also Proposal: Drop @View decorator

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567