Does Angular have a let-name directive?

167 views Asked by At

In this article the author uses a let-name directive on the template like this:

<ng-template #testTemplate let-name>
   <div>User {{ name }} </div>        
</ng-template>`

Is that part of angular/core or angular/cdk directives or something the author invented?

1

There are 1 answers

0
codrp On BEST ANSWER

From Angular Docs

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>

For example, microsyntax in Angular allows you to write

<div *ngFor="let item of items">{{item}}</div>

instead of

<ng-template ngFor let-item [ngForOf]="items"><div>{{item}}</div></ng-template>.