Angular 有 let-name 指令吗?
Does Angular have a let-name directive?
在 this article 中,作者在模板上使用了 let-name
指令,如下所示:
<ng-template #testTemplate let-name>
<div>User {{ name }} </div>
</ng-template>`
那是 angular/core
或 angular/cdk
指令的一部分还是作者发明的东西?
The Angular microsyntax lets you configure a directive in a compact,
friendly string. The microsyntax parser translates that string into
attributes on the <ng-template>
例如,Angular 中的微语法允许您编写
<div *ngFor="let item of items">{{item}}</div>
而不是
<ng-template ngFor let-item [ngForOf]="items"><div>{{item}}</div></ng-template>.
在 this article 中,作者在模板上使用了 let-name
指令,如下所示:
<ng-template #testTemplate let-name>
<div>User {{ name }} </div>
</ng-template>`
那是 angular/core
或 angular/cdk
指令的一部分还是作者发明的东西?
The Angular microsyntax lets you configure a directive in a compact, friendly string. The microsyntax parser translates that string into attributes on the
<ng-template>
例如,Angular 中的微语法允许您编写
<div *ngFor="let item of items">{{item}}</div>
而不是
<ng-template ngFor let-item [ngForOf]="items"><div>{{item}}</div></ng-template>.