Angular 2.0. Difference @View @Component

后端 未结 4 1997
一生所求
一生所求 2020-11-29 11:22

Hi. I\'m new to Angular. I\'m testing Angular 2.0.

I read the tuto here and the guide here. In the tuto, the template is specified in the @Component ann

4条回答
  •  隐瞒了意图╮
    2020-11-29 11:48

    As said by @Alexpods in answer and @Eric in comment before when angular2 is in alpha @view is juts optional because all the properties in the @view annotation is also included in the @component annotation so @view is just sugar that you can specify all view configuration into Component so there's no need to import View decorator.

    Updated to beta

    @View has been deprecated in latest release, So you can't use it.

    if you are using still @view annotation it may cause producing some kind of error. so Only Component is the place that will hold the all options.

    As per officials , @View metadata decorator has been deprecated in beta.10 release.

提交回复
热议问题