2017-05-23 33 views
0

我是angular2的新手。我想知道#(散列)在angular2中做了什么。 e.g#(散列)在angular2中做了什么

<ion-card #mycards1 swing-card *ngFor="let group of groups"> 

 <ul> 
      <li 
      *ngFor="#Item of Items" 
      (click)="onItemClicked(Item)"> 
       {{ Item.name }} 
      </li> 
     </ul> 

回答

-1

它来定义打字稿格式的变量1路。

<div *ngFor="let hero of heroes">{{hero.name}}</div> 
<input #heroInput> {{heroInput.value}} 

的表达还可以指模板的上下文的特性,例如作为模板输入变量(让主人公)或模板参考变量(#heroInput)。

https://angular.io/docs/ts/latest/guide/template-syntax.html