Can one component have multiple templates?

后端 未结 2 1738
醉梦人生
醉梦人生 2021-01-06 13:36

Is there a way for Angular 2 component to use many template files base on where i want to place it?

For example, I have a login component and i want to

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-06 14:33

    The simplest way to do this, i think, is using *ngIf in your template.

    First Template
    Second Template

提交回复
热议问题