[Angular Directive] Structure directive and <template>

The structure directive is just a sugar syntax of <template>.

 

Such as:

<div *ngIf="name.length > 2">
    This is something...
</div>

 

Equal to:

<template [ngIf]="name.length > 2">
    <div> There are somoething</div>
</template>

 

posted @ 2017-01-17 16:55  Zhentiw  阅读(117)  评论(0编辑  收藏  举报