-
Notifications
You must be signed in to change notification settings - Fork 22
Angular语法(二)——模板语法
L edited this page Mar 1, 2018
·
3 revisions
<img src="{{heroImageUrl}}" style="height:30px">
<!-- "The sum of 1 + 1 is 2" -->
<p>The sum of 1 + 1 is {{1 + 1}}</p>
<!-- "The sum of 1 + 1 is not 4" -->
<p>The sum of 1 + 1 is not {{1 + 1 + getVal()}}</p>
(event)="statement"
<button (click)="deleteHero()">Delete hero</button>
传参
<button (click)="onSave($event)">Save</button>
<button *ngFor="let hero of heroes" (click)="deleteHero(hero)">{{hero.name}}</button>
<form #heroForm (ngSubmit)="onSubmit(heroForm)"> ... </form>