parent
1e64d9e57a
commit
216120daba
|
@ -1,7 +1,7 @@
|
||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<h2>Hero List</h2>
|
<h2>Hero List</h2>
|
||||||
|
|
||||||
<div *ngFor="#hero of heroes" (click)="selectHero(hero)">
|
<div *ngFor="let hero of heroes" (click)="selectHero(hero)">
|
||||||
{{hero.name}}
|
{{hero.name}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
<!--#enddocregion binding -->
|
<!--#enddocregion binding -->
|
||||||
|
|
||||||
<!--#docregion structural -->
|
<!--#docregion structural -->
|
||||||
<div *ngFor="#hero of heroes" ...>...</div>
|
<div *ngFor="let hero of heroes" ...>...</div>
|
||||||
<hero-detail *ngIf="selectedHero != null" ...></hero-detail>
|
<hero-detail *ngIf="selectedHero != null" ...></hero-detail>
|
||||||
<!--#enddocregion structural -->
|
<!--#enddocregion structural -->
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<!--#enddocregion binding -->
|
<!--#enddocregion binding -->
|
||||||
|
|
||||||
<!--#docregion structural -->
|
<!--#docregion structural -->
|
||||||
<div *ngFor="#hero of heroes"></div>
|
<div *ngFor="let hero of heroes"></div>
|
||||||
<hero-detail *ngIf="selectedHero"></hero-detail>
|
<hero-detail *ngIf="selectedHero"></hero-detail>
|
||||||
|
|
||||||
<!--#enddocregion structural -->
|
<!--#enddocregion structural -->
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<h2>Hero List</h2>
|
<h2>Hero List</h2>
|
||||||
|
|
||||||
<p><i>Pick a hero from the list</i></p>
|
<p><i>Pick a hero from the list</i></p>
|
||||||
<div *ngFor="#hero of heroes" (click)="selectHero(hero)">
|
<div *ngFor="let hero of heroes" (click)="selectHero(hero)">
|
||||||
{{hero.name}}
|
{{hero.name}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
<h3>Movie Titles via local variable</h3>
|
<h3>Movie Titles via local variable</h3>
|
||||||
<table>
|
<table>
|
||||||
<!-- #docregion local -->
|
<!-- #docregion local -->
|
||||||
<tr *ngFor="#movie of movies">
|
<tr *ngFor="let movie of movies">
|
||||||
<td>{{movie.title}}</td>
|
<td>{{movie.title}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- #enddocregion local -->
|
<!-- #enddocregion local -->
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
<h3>Sliced Movies with pipes</h3>
|
<h3>Sliced Movies with pipes</h3>
|
||||||
<table>
|
<table>
|
||||||
<!-- #docregion slice -->
|
<!-- #docregion slice -->
|
||||||
<tr *ngFor="#movie of movies | slice:0:2">
|
<tr *ngFor="let movie of movies | slice:0:2">
|
||||||
<!-- #enddocregion slice -->
|
<!-- #enddocregion slice -->
|
||||||
|
|
||||||
<!-- #docregion uppercase -->
|
<!-- #docregion uppercase -->
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {DatePipe} from 'angular2/common';
|
||||||
// #docregion date-pipe
|
// #docregion date-pipe
|
||||||
@Pipe({name: 'date', pure: true})
|
@Pipe({name: 'date', pure: true})
|
||||||
export class StringSafeDatePipe extends DatePipe {
|
export class StringSafeDatePipe extends DatePipe {
|
||||||
transform(value: any, args: any[]): string {
|
transform(value: any, args: string): string {
|
||||||
value = typeof value === 'string' ?
|
value = typeof value === 'string' ?
|
||||||
Date.parse(value) : value
|
Date.parse(value) : value
|
||||||
return super.transform(value, args);
|
return super.transform(value, args);
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<!-- #docregion ngFor -->
|
<!-- #docregion ngFor -->
|
||||||
<tr *ngFor="#movie of movies">
|
<tr *ngFor="let movie of movies">
|
||||||
<!-- #enddocregion ngFor -->
|
<!-- #enddocregion ngFor -->
|
||||||
<td>
|
<td>
|
||||||
<img [hidden]="!showImage || !movie.imageurl"
|
<img [hidden]="!showImage || !movie.imageurl"
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {HEROES} from './hero';
|
||||||
selector: 'hero-parent',
|
selector: 'hero-parent',
|
||||||
template: `
|
template: `
|
||||||
<h2>{{master}} controls {{heroes.length}} heroes</h2>
|
<h2>{{master}} controls {{heroes.length}} heroes</h2>
|
||||||
<hero-child *ngFor="#hero of heroes"
|
<hero-child *ngFor="let hero of heroes"
|
||||||
[hero]="hero"
|
[hero]="hero"
|
||||||
[master]="master">
|
[master]="master">
|
||||||
</hero-child>
|
</hero-child>
|
||||||
|
|
|
@ -8,12 +8,12 @@ import {MissionService} from './mission.service';
|
||||||
template: `
|
template: `
|
||||||
<h2>Mission Control</h2>
|
<h2>Mission Control</h2>
|
||||||
<button (click)="announce()">Announce mission</button>
|
<button (click)="announce()">Announce mission</button>
|
||||||
<my-astronaut *ngFor="#astronaut of astronauts"
|
<my-astronaut *ngFor="let astronaut of astronauts"
|
||||||
[astronaut]="astronaut">
|
[astronaut]="astronaut">
|
||||||
</my-astronaut>
|
</my-astronaut>
|
||||||
<h3>History</h3>
|
<h3>History</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="#event of history">{{event}}</li>
|
<li *ngFor="let event of history">{{event}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
`,
|
`,
|
||||||
directives: [AstronautComponent],
|
directives: [AstronautComponent],
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {NameChildComponent} from './name-child.component';
|
||||||
selector: 'name-parent',
|
selector: 'name-parent',
|
||||||
template: `
|
template: `
|
||||||
<h2>Master controls {{names.length}} names</h2>
|
<h2>Master controls {{names.length}} names</h2>
|
||||||
<name-child *ngFor="#name of names"
|
<name-child *ngFor="let name of names"
|
||||||
[name]="name">
|
[name]="name">
|
||||||
</name-child>
|
</name-child>
|
||||||
`,
|
`,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* tslint:disable:forin */
|
||||||
// #docregion
|
// #docregion
|
||||||
import {Component, Input, OnChanges, SimpleChange} from 'angular2/core';
|
import {Component, Input, OnChanges, SimpleChange} from 'angular2/core';
|
||||||
|
|
||||||
|
@ -7,7 +8,7 @@ import {Component, Input, OnChanges, SimpleChange} from 'angular2/core';
|
||||||
<h3>Version {{major}}.{{minor}}</h3>
|
<h3>Version {{major}}.{{minor}}</h3>
|
||||||
<h4>Change log:</h4>
|
<h4>Change log:</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="#change of changeLog">{{change}}</li>
|
<li *ngFor="let change of changeLog">{{change}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -27,4 +28,4 @@ export class VersionChildComponent implements OnChanges {
|
||||||
this.changeLog.push(log.join(', '));
|
this.changeLog.push(log.join(', '));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {VoterComponent} from './voter.component';
|
||||||
template: `
|
template: `
|
||||||
<h2>Should mankind colonize the Universe?</h2>
|
<h2>Should mankind colonize the Universe?</h2>
|
||||||
<h3>Agree: {{agreed}}, Disagree: {{disagreed}}</h3>
|
<h3>Agree: {{agreed}}, Disagree: {{disagreed}}</h3>
|
||||||
<my-voter *ngFor="#voter of voters"
|
<my-voter *ngFor="let voter of voters"
|
||||||
[name]="voter"
|
[name]="voter"
|
||||||
(onVoted)="onVoted($event)">
|
(onVoted)="onVoted($event)">
|
||||||
</my-voter>
|
</my-voter>
|
||||||
|
@ -23,4 +23,4 @@ export class VoteTakerComponent {
|
||||||
agreed ? this.agreed++ : this.disagreed++;
|
agreed ? this.agreed++ : this.disagreed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
|
|
@ -30,7 +30,7 @@ const template = `
|
||||||
|
|
||||||
<p>Logs:</p>
|
<p>Logs:</p>
|
||||||
<div id="logs">
|
<div id="logs">
|
||||||
<div *ngFor="#log of logs">{{log}}</div>
|
<div *ngFor="let log of logs">{{log}}</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {HeroService} from './hero.service';
|
||||||
// #docregion heroes-base, injection
|
// #docregion heroes-base, injection
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'unsorted-heroes',
|
selector: 'unsorted-heroes',
|
||||||
template: `<div *ngFor="#hero of heroes">{{hero.name}}</div>`,
|
template: `<div *ngFor="let hero of heroes">{{hero.name}}</div>`,
|
||||||
providers: [HeroService]
|
providers: [HeroService]
|
||||||
})
|
})
|
||||||
export class HeroesBaseComponent implements OnInit {
|
export class HeroesBaseComponent implements OnInit {
|
||||||
|
@ -33,7 +33,7 @@ export class HeroesBaseComponent implements OnInit {
|
||||||
// #docregion sorted-heroes
|
// #docregion sorted-heroes
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'sorted-heroes',
|
selector: 'sorted-heroes',
|
||||||
template: `<div *ngFor="#hero of heroes">{{hero.name}}</div>`,
|
template: `<div *ngFor="let hero of heroes">{{hero.name}}</div>`,
|
||||||
providers: [HeroService]
|
providers: [HeroService]
|
||||||
})
|
})
|
||||||
export class SortedHeroesComponent extends HeroesBaseComponent {
|
export class SortedHeroesComponent extends HeroesBaseComponent {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
[id]="question.key" [type]="question.type">
|
[id]="question.key" [type]="question.type">
|
||||||
|
|
||||||
<select [id]="question.key" *ngSwitchWhen="'dropdown'" [ngControl]="question.key">
|
<select [id]="question.key" *ngSwitchWhen="'dropdown'" [ngControl]="question.key">
|
||||||
<option *ngFor="#opt of question.options" [value]="opt.key">{{opt.value}}</option>
|
<option *ngFor="let opt of question.options" [value]="opt.key">{{opt.value}}</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div>
|
<div>
|
||||||
<form (ngSubmit)="onSubmit()" [ngFormModel]="form">
|
<form (ngSubmit)="onSubmit()" [ngFormModel]="form">
|
||||||
|
|
||||||
<div *ngFor="#question of questions" class="form-row">
|
<div *ngFor="let question of questions" class="form-row">
|
||||||
<df-question [question]="question" [form]="form"></df-question>
|
<df-question [question]="question" [form]="form"></df-question>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ class HeroComponent {
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'heroes-queries',
|
selector: 'heroes-queries',
|
||||||
template: `
|
template: `
|
||||||
<hero *ngFor="#hero of heroData"
|
<hero *ngFor="let hero of heroData"
|
||||||
[hero]="hero">
|
[hero]="hero">
|
||||||
<active-label></active-label>
|
<active-label></active-label>
|
||||||
</hero>
|
</hero>
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {Hero} from './hero';
|
||||||
<link rel="stylesheet" href="app/hero-team.component.css">
|
<link rel="stylesheet" href="app/hero-team.component.css">
|
||||||
<h3>Team</h3>
|
<h3>Team</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="#member of hero.team">
|
<li *ngFor="let member of hero.team">
|
||||||
{{member}}
|
{{member}}
|
||||||
</li>
|
</li>
|
||||||
</ul>`
|
</ul>`
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
// #docregion
|
// #docregion
|
||||||
import { Component } from 'angular2/core';
|
import { Component } from 'angular2/core';
|
||||||
import { Hero } from './hero';
|
|
||||||
import { HEROES } from './mock-heroes';
|
import { HEROES } from './mock-heroes';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list',
|
selector: 'hero-list',
|
||||||
template: `
|
template: `
|
||||||
<div *ngFor="#hero of heroes">
|
<div *ngFor="let hero of heroes">
|
||||||
{{hero.id}} - {{hero.name}}
|
{{hero.id}} - {{hero.name}}
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { HeroService } from './hero.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list',
|
selector: 'hero-list',
|
||||||
template: `
|
template: `
|
||||||
<div *ngFor="#hero of heroes">
|
<div *ngFor="let hero of heroes">
|
||||||
{{hero.id}} - {{hero.name}}
|
{{hero.id}} - {{hero.name}}
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
|
@ -14,9 +14,9 @@ import { HeroService } from './hero.service';
|
||||||
export class HeroListComponent {
|
export class HeroListComponent {
|
||||||
heroes: Hero[];
|
heroes: Hero[];
|
||||||
|
|
||||||
//#docregion ctor
|
// #docregion ctor
|
||||||
constructor(heroService: HeroService) {
|
constructor(heroService: HeroService) {
|
||||||
this.heroes = heroService.getHeroes();
|
this.heroes = heroService.getHeroes();
|
||||||
}
|
}
|
||||||
//#enddocregion ctor
|
// #enddocregion ctor
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { HeroService } from './hero.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list',
|
selector: 'hero-list',
|
||||||
template: `
|
template: `
|
||||||
<div *ngFor="#hero of heroes">
|
<div *ngFor="let hero of heroes">
|
||||||
{{hero.id}} - {{hero.name}}
|
{{hero.id}} - {{hero.name}}
|
||||||
({{hero.isSecret ? 'secret' : 'public'}})
|
({{hero.isSecret ? 'secret' : 'public'}})
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,9 +15,9 @@ import { HeroService } from './hero.service';
|
||||||
export class HeroListComponent {
|
export class HeroListComponent {
|
||||||
heroes: Hero[];
|
heroes: Hero[];
|
||||||
|
|
||||||
//#docregion ctor-signature
|
// #docregion ctor-signature
|
||||||
constructor(heroService: HeroService) {
|
constructor(heroService: HeroService) {
|
||||||
//#enddocregion ctor-signature
|
// #enddocregion ctor-signature
|
||||||
this.heroes = heroService.getHeroes();
|
this.heroes = heroService.getHeroes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {Component} from 'angular2/core';
|
||||||
<p>Heroes:</p>
|
<p>Heroes:</p>
|
||||||
<ul>
|
<ul>
|
||||||
// #docregion li-repeater
|
// #docregion li-repeater
|
||||||
<li *ngFor="#hero of heroes">
|
<li *ngFor="let hero of heroes">
|
||||||
{{ hero }}
|
{{ hero }}
|
||||||
</li>
|
</li>
|
||||||
// #enddocregion li-repeater
|
// #enddocregion li-repeater
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {Hero} from './hero';
|
||||||
<h2>My favorite hero is: {{myHero.name}}</h2>
|
<h2>My favorite hero is: {{myHero.name}}</h2>
|
||||||
<p>Heroes:</p>
|
<p>Heroes:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="#hero of heroes">
|
<li *ngFor="let hero of heroes">
|
||||||
{{ hero.name }}
|
{{ hero.name }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {Hero} from './hero';
|
||||||
<h2>My favorite hero is: {{myHero.name}}</h2>
|
<h2>My favorite hero is: {{myHero.name}}</h2>
|
||||||
<p>Heroes:</p>
|
<p>Heroes:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="#hero of heroes">
|
<li *ngFor="let hero of heroes">
|
||||||
{{ hero.name }}
|
{{ hero.name }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<select class="form-control" required
|
<select class="form-control" required
|
||||||
[(ngModel)]="model.power"
|
[(ngModel)]="model.power"
|
||||||
ngControl="power" >
|
ngControl="power" >
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<select class="form-control" required
|
<select class="form-control" required
|
||||||
[(ngModel)]="model.power"
|
[(ngModel)]="model.power"
|
||||||
ngControl="power" >
|
ngControl="power" >
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<label for="power">Hero Power</label>
|
<label for="power">Hero Power</label>
|
||||||
<select class="form-control" required
|
<select class="form-control" required
|
||||||
[(ngModel)]="model.power">
|
[(ngModel)]="model.power">
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<!-- #enddocregion ngModel-2 -->
|
<!-- #enddocregion ngModel-2 -->
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="power">Hero Power</label>
|
<label for="power">Hero Power</label>
|
||||||
<select class="form-control" required>
|
<select class="form-control" required>
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<!-- #enddocregion powers -->
|
<!-- #enddocregion powers -->
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<label for="power">Hero Power</label>
|
<label for="power">Hero Power</label>
|
||||||
<select class="form-control" required
|
<select class="form-control" required
|
||||||
[(ngModel)]="model.power">
|
[(ngModel)]="model.power">
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<select class="form-control" required
|
<select class="form-control" required
|
||||||
[(ngModel)]="model.power"
|
[(ngModel)]="model.power"
|
||||||
ngControl="power" >
|
ngControl="power" >
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<select class="form-control" required
|
<select class="form-control" required
|
||||||
[(ngModel)]="model.power"
|
[(ngModel)]="model.power"
|
||||||
ngControl="power" #power="ngForm" >
|
ngControl="power" #power="ngForm" >
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
<div [hidden]="power.valid" class="alert alert-danger">
|
<div [hidden]="power.valid" class="alert alert-danger">
|
||||||
Power is required
|
Power is required
|
||||||
|
@ -110,7 +110,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="power">Hero Power</label>
|
<label for="power">Hero Power</label>
|
||||||
<select class="form-control" required>
|
<select class="form-control" required>
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@
|
||||||
<label for="power">Hero Power</label>
|
<label for="power">Hero Power</label>
|
||||||
<select class="form-control" required
|
<select class="form-control" required
|
||||||
[(ngModel)]="model.power" >
|
[(ngModel)]="model.power" >
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<select class="form-control" required
|
<select class="form-control" required
|
||||||
[(ngModel)]="model.power"
|
[(ngModel)]="model.power"
|
||||||
ngControl="power" #power="ngForm" >
|
ngControl="power" #power="ngForm" >
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
<div [hidden]="power.valid || power.pristine" class="alert alert-danger">
|
<div [hidden]="power.valid || power.pristine" class="alert alert-danger">
|
||||||
Power is required
|
Power is required
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="power">Hero Power</label>
|
<label for="power">Hero Power</label>
|
||||||
<select class="form-control" required>
|
<select class="form-control" required>
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@
|
||||||
<label for="power">Hero Power</label>
|
<label for="power">Hero Power</label>
|
||||||
<select class="form-control" required
|
<select class="form-control" required
|
||||||
[(ngModel)]="model.power" >
|
[(ngModel)]="model.power" >
|
||||||
<option *ngFor="#p of powers" [value]="p">{{p}}</option>
|
<option *ngFor="let p of powers" [value]="p">{{p}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {Hero} from './hero';
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="#editItem of heroes">
|
<li *ngFor="let editItem of heroes">
|
||||||
<hero-card
|
<hero-card
|
||||||
[hidden]="editItem.editing"
|
[hidden]="editItem.editing"
|
||||||
[hero]="editItem.item">
|
[hero]="editItem.item">
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
|
|
||||||
<script src="https://code.angularjs.org/tools/system.js"></script>
|
<script src="https://code.angularjs.org/tools/system.js"></script>
|
||||||
<script src="https://code.angularjs.org/tools/typescript.js"></script>
|
<script src="https://code.angularjs.org/tools/typescript.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2-polyfills.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2-polyfills.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-beta.16/Rx.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-beta.17/Rx.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2.dev.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2.dev.js"></script>
|
||||||
|
|
||||||
<!-- 2. Configure SystemJS -->
|
<!-- 2. Configure SystemJS -->
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -15,7 +15,7 @@ class Detail {
|
||||||
<template ui-pane title='Overview' active="true">
|
<template ui-pane title='Overview' active="true">
|
||||||
You have {{details.length}} details.
|
You have {{details.length}} details.
|
||||||
</template>
|
</template>
|
||||||
<template *ngFor="#detail of details" ui-pane [title]="detail.title">
|
<template *ngFor="let detail of details" ui-pane [title]="detail.title">
|
||||||
{{detail.text}} <br><br>
|
{{detail.text}} <br><br>
|
||||||
<button class="btn" (click)="removeDetail(detail)">Remove</button>
|
<button class="btn" (click)="removeDetail(detail)">Remove</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -31,7 +31,7 @@ export class UiPane {
|
||||||
selector: 'ui-tabs',
|
selector: 'ui-tabs',
|
||||||
template: `
|
template: `
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li *ngFor="var pane of panes"
|
<li *ngFor="let pane of panes"
|
||||||
(click)="select(pane)"
|
(click)="select(pane)"
|
||||||
role="presentation" [class.active]="pane.active">
|
role="presentation" [class.active]="pane.active">
|
||||||
<a>{{pane.title}}</a>
|
<a>{{pane.title}}</a>
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
|
|
||||||
<script src="https://code.angularjs.org/tools/system.js"></script>
|
<script src="https://code.angularjs.org/tools/system.js"></script>
|
||||||
<script src="https://code.angularjs.org/tools/typescript.js"></script>
|
<script src="https://code.angularjs.org/tools/typescript.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2-polyfills.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2-polyfills.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-beta.16/Rx.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-beta.17/Rx.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2.dev.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2.dev.js"></script>
|
||||||
|
|
||||||
<!-- 2. Configure SystemJS -->
|
<!-- 2. Configure SystemJS -->
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {Todo} from './todo';
|
||||||
],
|
],
|
||||||
template: `
|
template: `
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li *ngFor="#todo of todos">
|
<li *ngFor="let todo of todos">
|
||||||
<input type="checkbox" [(ngModel)]="todo.done">
|
<input type="checkbox" [(ngModel)]="todo.done">
|
||||||
<span class="done-{{todo.done}}">{{todo.text}}</span>
|
<span class="done-{{todo.done}}">{{todo.text}}</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
|
|
||||||
<script src="https://code.angularjs.org/tools/system.js"></script>
|
<script src="https://code.angularjs.org/tools/system.js"></script>
|
||||||
<script src="https://code.angularjs.org/tools/typescript.js"></script>
|
<script src="https://code.angularjs.org/tools/typescript.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2-polyfills.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2-polyfills.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-beta.16/Rx.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-beta.17/Rx.js"></script>
|
||||||
<script src="https://code.angularjs.org/2.0.0-beta.16/angular2.dev.js"></script>
|
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2.dev.js"></script>
|
||||||
|
|
||||||
<!-- 2. Configure SystemJS -->
|
<!-- 2. Configure SystemJS -->
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -95,7 +95,7 @@ export class AfterContentComponent implements AfterContentChecked, AfterContent
|
||||||
|
|
||||||
<h4>-- AfterContent Logs --</h4>
|
<h4>-- AfterContent Logs --</h4>
|
||||||
<p><button (click)="reset()">Reset</button></p>
|
<p><button (click)="reset()">Reset</button></p>
|
||||||
<div *ngFor="#msg of logs">{{msg}}</div>
|
<div *ngFor="let msg of logs">{{msg}}</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styles: ['.parent {background: burlywood}'],
|
styles: ['.parent {background: burlywood}'],
|
||||||
|
|
|
@ -97,7 +97,7 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit {
|
||||||
|
|
||||||
<h4>-- AfterView Logs --</h4>
|
<h4>-- AfterView Logs --</h4>
|
||||||
<p><button (click)="reset()">Reset</button></p>
|
<p><button (click)="reset()">Reset</button></p>
|
||||||
<div *ngFor="#msg of logs">{{msg}}</div>
|
<div *ngFor="let msg of logs">{{msg}}</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styles: ['.parent {background: burlywood}'],
|
styles: ['.parent {background: burlywood}'],
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {LoggerService} from './logger.service';
|
||||||
Counter = {{counter}}
|
Counter = {{counter}}
|
||||||
|
|
||||||
<h5>-- Counter Change Log --</h5>
|
<h5>-- Counter Change Log --</h5>
|
||||||
<div *ngFor="#chg of changeLog" my-spy>{{chg}}</div>
|
<div *ngFor="let chg of changeLog" my-spy>{{chg}}</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styles: ['.counter {background: LightYellow; padding: 8px; margin-top: 8px}'],
|
styles: ['.counter {background: LightYellow; padding: 8px; margin-top: 8px}'],
|
||||||
|
@ -55,7 +55,7 @@ export class MyCounter implements OnChanges {
|
||||||
<my-counter [counter]="value"></my-counter>
|
<my-counter [counter]="value"></my-counter>
|
||||||
|
|
||||||
<h4>-- Spy Lifecycle Hook Log --</h4>
|
<h4>-- Spy Lifecycle Hook Log --</h4>
|
||||||
<div *ngFor="#msg of spyLog">{{msg}}</div>
|
<div *ngFor="let msg of spyLog">{{msg}}</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styles: ['.parent {background: gold;}'],
|
styles: ['.parent {background: gold;}'],
|
||||||
|
|
|
@ -12,7 +12,7 @@ class Hero {
|
||||||
<p>{{hero.name}} can {{power}}</p>
|
<p>{{hero.name}} can {{power}}</p>
|
||||||
|
|
||||||
<h4>-- Change Log --</h4>
|
<h4>-- Change Log --</h4>
|
||||||
<div *ngFor="#chg of changeLog">{{chg}}</div>
|
<div *ngFor="let chg of changeLog">{{chg}}</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styles: [
|
styles: [
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Hero {
|
||||||
<p>{{hero.name}} can {{power}}</p>
|
<p>{{hero.name}} can {{power}}</p>
|
||||||
|
|
||||||
<h4>-- Change Log --</h4>
|
<h4>-- Change Log --</h4>
|
||||||
<div *ngFor="#chg of changeLog">{{chg}}</div>
|
<div *ngFor="let chg of changeLog">{{chg}}</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styles: [
|
styles: [
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {LoggerService} from './logger.service';
|
||||||
</peek-a-boo>
|
</peek-a-boo>
|
||||||
|
|
||||||
<h4>-- Lifecycle Hook Log --</h4>
|
<h4>-- Lifecycle Hook Log --</h4>
|
||||||
<div *ngFor="#msg of hookLog">{{msg}}</div>
|
<div *ngFor="let msg of hookLog">{{msg}}</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styles: ['.parent {background: moccasin}'],
|
styles: ['.parent {background: moccasin}'],
|
||||||
|
|
|
@ -16,12 +16,12 @@ import {Spy} from './spy.directive';
|
||||||
<button (click)="reset()">Reset Heroes</button>
|
<button (click)="reset()">Reset Heroes</button>
|
||||||
</p>` +
|
</p>` +
|
||||||
// #docregion template
|
// #docregion template
|
||||||
`<div *ngFor="#hero of heroes" my-spy class="heroes">
|
`<div *ngFor="let hero of heroes" my-spy class="heroes">
|
||||||
{{hero}}
|
{{hero}}
|
||||||
</div>`
|
</div>`
|
||||||
// #enddocregion template
|
// #enddocregion template
|
||||||
+ `<h4>-- Spy Lifecycle Hook Log --</h4>
|
+ `<h4>-- Spy Lifecycle Hook Log --</h4>
|
||||||
<div *ngFor="#msg of spyLog">{{msg}}</div>
|
<div *ngFor="let msg of spyLog">{{msg}}</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styles: [
|
styles: [
|
||||||
|
|
|
@ -19,14 +19,14 @@
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "2.0.0-beta.16",
|
"angular2": "2.0.0-beta.17",
|
||||||
"systemjs": "0.19.26",
|
"systemjs": "0.19.26",
|
||||||
"es6-shim": "^0.35.0",
|
"es6-shim": "^0.35.0",
|
||||||
"reflect-metadata": "0.1.2",
|
"reflect-metadata": "0.1.2",
|
||||||
"rxjs": "5.0.0-beta.2",
|
"rxjs": "5.0.0-beta.6",
|
||||||
"zone.js": "^0.6.12",
|
"zone.js": "^0.6.12",
|
||||||
|
|
||||||
"a2-in-memory-web-api": "^0.1.16",
|
"a2-in-memory-web-api": "^0.1.17",
|
||||||
"bootstrap": "^3.3.6"
|
"bootstrap": "^3.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -20,7 +20,7 @@ New hero:
|
||||||
<h4>Heroes who fly (piped)</h4>
|
<h4>Heroes who fly (piped)</h4>
|
||||||
<div id="flyers">
|
<div id="flyers">
|
||||||
<!-- #docregion template-flying-heroes -->
|
<!-- #docregion template-flying-heroes -->
|
||||||
<div *ngFor="#hero of (heroes | flyingHeroes)">
|
<div *ngFor="let hero of (heroes | flyingHeroes)">
|
||||||
{{hero.name}}
|
{{hero.name}}
|
||||||
</div>
|
</div>
|
||||||
<!-- #enddocregion template-flying-heroes -->
|
<!-- #enddocregion template-flying-heroes -->
|
||||||
|
@ -30,7 +30,7 @@ New hero:
|
||||||
<div id="all">
|
<div id="all">
|
||||||
<!-- #docregion template-1 -->
|
<!-- #docregion template-1 -->
|
||||||
<!-- #docregion template-all-heroes -->
|
<!-- #docregion template-all-heroes -->
|
||||||
<div *ngFor="#hero of heroes">
|
<div *ngFor="let hero of heroes">
|
||||||
{{hero.name}}
|
{{hero.name}}
|
||||||
</div>
|
</div>
|
||||||
<!-- #enddocregion template-all-heroes -->
|
<!-- #enddocregion template-all-heroes -->
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {FetchJsonPipe} from './fetch-json.pipe';
|
||||||
template: `
|
template: `
|
||||||
<h2>Heroes from JSON File</h2>
|
<h2>Heroes from JSON File</h2>
|
||||||
|
|
||||||
<div *ngFor="#hero of ('heroes.json' | fetch) ">
|
<div *ngFor="let hero of ('heroes.json' | fetch) ">
|
||||||
{{hero.name}}
|
{{hero.name}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
},
|
},
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "2.0.0-beta.16",
|
"angular2": "2.0.0-beta.17",
|
||||||
"es6-shim": "^0.35.0",
|
"es6-shim": "^0.35.0",
|
||||||
"reflect-metadata": "0.1.2",
|
"reflect-metadata": "0.1.2",
|
||||||
"rxjs": "5.0.0-beta.2",
|
"rxjs": "5.0.0-beta.6",
|
||||||
"zone.js": "0.6.12"
|
"zone.js": "0.6.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
},
|
},
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "2.0.0-beta.16",
|
"angular2": "2.0.0-beta.17",
|
||||||
"systemjs": "0.19.26",
|
"systemjs": "0.19.26",
|
||||||
"es6-shim": "^0.35.0",
|
"es6-shim": "^0.35.0",
|
||||||
"reflect-metadata": "0.1.2",
|
"reflect-metadata": "0.1.2",
|
||||||
"rxjs": "5.0.0-beta.2",
|
"rxjs": "5.0.0-beta.6",
|
||||||
"zone.js": "0.6.12"
|
"zone.js": "0.6.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"ambientDependencies": {
|
"ambientDependencies": {
|
||||||
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
|
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
|
||||||
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
|
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {Router} from 'angular2/router';
|
||||||
// #docregion template
|
// #docregion template
|
||||||
template: `
|
template: `
|
||||||
<ul class="items">
|
<ul class="items">
|
||||||
<li *ngFor="#crisis of crises"
|
<li *ngFor="let crisis of crises"
|
||||||
(click)="onSelect(crisis)">
|
(click)="onSelect(crisis)">
|
||||||
<span class="badge">{{crisis.id}}</span> {{crisis.name}}
|
<span class="badge">{{crisis.id}}</span> {{crisis.name}}
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {Router, RouteParams} from 'angular2/router';
|
||||||
@Component({
|
@Component({
|
||||||
template: `
|
template: `
|
||||||
<ul class="items">
|
<ul class="items">
|
||||||
<li *ngFor="#crisis of crises"
|
<li *ngFor="let crisis of crises"
|
||||||
[class.selected]="isSelected(crisis)"
|
[class.selected]="isSelected(crisis)"
|
||||||
(click)="onSelect(crisis)">
|
(click)="onSelect(crisis)">
|
||||||
<span class="badge">{{crisis.id}}</span> {{crisis.name}}
|
<span class="badge">{{crisis.id}}</span> {{crisis.name}}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {Router} from 'angular2/router';
|
||||||
template: `
|
template: `
|
||||||
<h2>HEROES</h2>
|
<h2>HEROES</h2>
|
||||||
<ul class="items">
|
<ul class="items">
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {Router, RouteParams} from 'angular2/router';
|
||||||
template: `
|
template: `
|
||||||
<h2>HEROES</h2>
|
<h2>HEROES</h2>
|
||||||
<ul class="items">
|
<ul class="items">
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
[class.selected]="isSelected(hero)"
|
[class.selected]="isSelected(hero)"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<h3>Heroes:</h3>
|
<h3>Heroes:</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="#hero of heroes">
|
<li *ngFor="let hero of heroes">
|
||||||
{{ hero.name }}
|
{{ hero.name }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -17,7 +17,7 @@ import {WikipediaService} from './wikipedia.service';
|
||||||
<input #term (keyup)="search(term.value)"/>
|
<input #term (keyup)="search(term.value)"/>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="#item of items | async">{{item}}</li>
|
<li *ngFor="let item of items | async">{{item}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
`,
|
`,
|
||||||
providers:[JSONP_PROVIDERS, WikipediaService]
|
providers:[JSONP_PROVIDERS, WikipediaService]
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {WikipediaService} from './wikipedia.service';
|
||||||
<input #term (keyup)="search(term.value)"/>
|
<input #term (keyup)="search(term.value)"/>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="#item of items | async">{{item}}</li>
|
<li *ngFor="let item of items | async">{{item}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
`,
|
`,
|
||||||
providers:[JSONP_PROVIDERS, WikipediaService]
|
providers:[JSONP_PROVIDERS, WikipediaService]
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<!-- #docregion structural-directives -->
|
<!-- #docregion structural-directives -->
|
||||||
<!-- #docregion asterisk -->
|
<!-- #docregion asterisk -->
|
||||||
<div *ngIf="hero != null">{{hero}}</div>
|
<div *ngIf="hero != null">{{hero}}</div>
|
||||||
<div *ngFor="#hero of heroes">{{hero}}</div>
|
<div *ngFor="let hero of heroes">{{hero}}</div>
|
||||||
<!-- #enddocregion asterisk -->
|
<!-- #enddocregion asterisk -->
|
||||||
<!-- #docregion ngSwitch -->
|
<!-- #docregion ngSwitch -->
|
||||||
<div [ngSwitch]="status">
|
<div [ngSwitch]="status">
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h4>heavy-loader log:</h4>
|
<h4>heavy-loader log:</h4>
|
||||||
<div *ngFor="#message of logs">{{message}}</div>
|
<div *ngFor="let message of logs">{{message}}</div>
|
||||||
<!-- #enddocregion message-log -->
|
<!-- #enddocregion message-log -->
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -99,10 +99,10 @@
|
||||||
<!-- Examples (A) and (B) are the same -->
|
<!-- Examples (A) and (B) are the same -->
|
||||||
|
|
||||||
<!-- (A) *ngFor div -->
|
<!-- (A) *ngFor div -->
|
||||||
<div *ngFor="#hero of heroes">{{ hero }}</div>
|
<div *ngFor="let hero of heroes">{{ hero }}</div>
|
||||||
|
|
||||||
<!-- (B) ngFor with template -->
|
<!-- (B) ngFor with template -->
|
||||||
<template ngFor #hero [ngForOf]="heroes">
|
<template ngFor let-hero [ngForOf]="heroes">
|
||||||
<div>{{ hero }}</div>
|
<div>{{ hero }}</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- #enddocregion ngFor-template -->
|
<!-- #enddocregion ngFor-template -->
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<!-- #docregion structural-directives -->
|
<!-- #docregion structural-directives -->
|
||||||
<!-- #docregion asterisk -->
|
<!-- #docregion asterisk -->
|
||||||
<div *ngIf="hero">{{hero}}</div>
|
<div *ngIf="hero">{{hero}}</div>
|
||||||
<div *ngFor="#hero of heroes">{{hero}}</div>
|
<div *ngFor="let hero of heroes">{{hero}}</div>
|
||||||
<!-- #enddocregion asterisk -->
|
<!-- #enddocregion asterisk -->
|
||||||
<!-- #docregion ngSwitch -->
|
<!-- #docregion ngSwitch -->
|
||||||
<div [ngSwitch]="status">
|
<div [ngSwitch]="status">
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h4>heavy-loader log:</h4>
|
<h4>heavy-loader log:</h4>
|
||||||
<div *ngFor="#message of logs">{{message}}</div>
|
<div *ngFor="let message of logs">{{message}}</div>
|
||||||
<!-- #enddocregion message-log -->
|
<!-- #enddocregion message-log -->
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -99,10 +99,10 @@
|
||||||
<!-- Examples (A) and (B) are the same -->
|
<!-- Examples (A) and (B) are the same -->
|
||||||
|
|
||||||
<!-- (A) *ngFor div -->
|
<!-- (A) *ngFor div -->
|
||||||
<div *ngFor="#hero of heroes">{{ hero }}</div>
|
<div *ngFor="let hero of heroes">{{ hero }}</div>
|
||||||
|
|
||||||
<!-- (B) ngFor with template -->
|
<!-- (B) ngFor with template -->
|
||||||
<template ngFor #hero [ngForOf]="heroes">
|
<template ngFor let-hero [ngForOf]="heroes">
|
||||||
<div>{{ hero }}</div>
|
<div>{{ hero }}</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- #enddocregion ngFor-template -->
|
<!-- #enddocregion ngFor-template -->
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<div>
|
<div>
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes">
|
<li *ngFor="let hero of heroes">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div>
|
<div>
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes">
|
<li *ngFor="let hero of heroes">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
template: `
|
template: `
|
||||||
<section>
|
<section>
|
||||||
Our list of heroes:
|
Our list of heroes:
|
||||||
<hero-profile *ngFor="#hero of heroes" [hero]="hero">
|
<hero-profile *ngFor="let hero of heroes" [hero]="hero">
|
||||||
</hero-profile>
|
</hero-profile>
|
||||||
Total powers: {{totalPowers}}<br>
|
Total powers: {{totalPowers}}<br>
|
||||||
Average power: {{totalPowers / heroes.length}}
|
Average power: {{totalPowers / heroes.length}}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { Hero } from './hero.model.ts';
|
||||||
template: `
|
template: `
|
||||||
<section>
|
<section>
|
||||||
Our list of heroes:
|
Our list of heroes:
|
||||||
<hero-profile *ngFor="#hero of heroes" [hero]="hero">
|
<hero-profile *ngFor="let hero of heroes" [hero]="hero">
|
||||||
</hero-profile>
|
</hero-profile>
|
||||||
Total powers: {{totalPowers}}<br>
|
Total powers: {{totalPowers}}<br>
|
||||||
Average power: {{avgPower}}
|
Average power: {{avgPower}}
|
||||||
|
|
|
@ -523,7 +523,7 @@ bindon-ngModel
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- #docregion NgFor-1 -->
|
<!-- #docregion NgFor-1 -->
|
||||||
<div *ngFor="#hero of heroes">{{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes">{{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgFor-1 -->
|
<!-- #enddocregion NgFor-1 -->
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
@ -531,7 +531,7 @@ bindon-ngModel
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- *ngFor w/ hero-detail Component -->
|
<!-- *ngFor w/ hero-detail Component -->
|
||||||
<!-- #docregion NgFor-2 -->
|
<!-- #docregion NgFor-2 -->
|
||||||
<hero-detail *ngFor="#hero of heroes" [hero]="hero"></hero-detail>
|
<hero-detail *ngFor="let hero of heroes" [hero]="hero"></hero-detail>
|
||||||
<!-- #enddocregion NgFor-2 -->
|
<!-- #enddocregion NgFor-2 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -541,14 +541,14 @@ bindon-ngModel
|
||||||
<p>with <i>semi-colon</i> separator</p>
|
<p>with <i>semi-colon</i> separator</p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- #docregion NgFor-3 -->
|
<!-- #docregion NgFor-3 -->
|
||||||
<div *ngFor="#hero of heroes; #i=index">{{i + 1}} - {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes; let i=index">{{i + 1}} - {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgFor-3 -->
|
<!-- #enddocregion NgFor-3 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>with <i>comma</i> separator</p>
|
<p>with <i>comma</i> separator</p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- Ex: "1 - Hercules Son of Zeus"" -->
|
<!-- Ex: "1 - Hercules Son of Zeus"" -->
|
||||||
<div *ngFor="#hero of heroes, #i=index">{{i + 1}} - {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes, let i=index">{{i + 1}} - {{hero.fullName}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a class="to-toc" href="#toc">top</a>
|
<a class="to-toc" href="#toc">top</a>
|
||||||
|
@ -560,7 +560,7 @@ bindon-ngModel
|
||||||
<p><i>without</i> trackBy</p>
|
<p><i>without</i> trackBy</p>
|
||||||
<div #noTrackBy class="box">
|
<div #noTrackBy class="box">
|
||||||
<!-- #docregion NgForTrackBy-1 -->
|
<!-- #docregion NgForTrackBy-1 -->
|
||||||
<div *ngFor="#hero of heroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgForTrackBy-1 -->
|
<!-- #enddocregion NgForTrackBy-1 -->
|
||||||
</div>
|
</div>
|
||||||
<div id="noTrackByCnt" *ngIf="heroesNoTrackByChangeCount != 0" style="background-color:bisque">
|
<div id="noTrackByCnt" *ngIf="heroesNoTrackByChangeCount != 0" style="background-color:bisque">
|
||||||
|
@ -570,7 +570,7 @@ bindon-ngModel
|
||||||
<p>with trackBy and <i>semi-colon</i> separator</p>
|
<p>with trackBy and <i>semi-colon</i> separator</p>
|
||||||
<div #withTrackBy class="box">
|
<div #withTrackBy class="box">
|
||||||
<!-- #docregion NgForTrackBy-2 -->
|
<!-- #docregion NgForTrackBy-2 -->
|
||||||
<div *ngFor="#hero of heroes; trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes; trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgForTrackBy-2 -->
|
<!-- #enddocregion NgForTrackBy-2 -->
|
||||||
</div>
|
</div>
|
||||||
<div id="withTrackByCnt" *ngIf="heroesWithTrackByChangeCount != 0" style="background-color:bisque">
|
<div id="withTrackByCnt" *ngIf="heroesWithTrackByChangeCount != 0" style="background-color:bisque">
|
||||||
|
@ -579,25 +579,25 @@ bindon-ngModel
|
||||||
|
|
||||||
<p>with trackBy and <i>comma</i> separator</p>
|
<p>with trackBy and <i>comma</i> separator</p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div *ngFor="#hero of heroes, trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes, trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>with trackBy and <i>space</i> separator</p>
|
<p>with trackBy and <i>space</i> separator</p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div *ngFor="#hero of heroes trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>with <i>*ngForTrackBy</i></p>
|
<p>with <i>*ngForTrackBy</i></p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- #docregion NgForTrackBy-2 -->
|
<!-- #docregion NgForTrackBy-2 -->
|
||||||
<div *ngFor="#hero of heroes" *ngForTrackBy="trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes" *ngForTrackBy="trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgForTrackBy-2 -->
|
<!-- #enddocregion NgForTrackBy-2 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>with <i>generic</i> trackById function</p>
|
<p>with <i>generic</i> trackById function</p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- #docregion NgForTrackBy-3 -->
|
<!-- #docregion NgForTrackBy-3 -->
|
||||||
<div *ngFor="#hero of heroes" *ngForTrackBy="trackById">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes" *ngForTrackBy="trackById">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgForTrackBy-3 -->
|
<!-- #enddocregion NgForTrackBy-3 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -628,14 +628,14 @@ bindon-ngModel
|
||||||
<p><i>*ngFor</i></p>
|
<p><i>*ngFor</i></p>
|
||||||
<!-- *ngFor w/ hero-detail Component -->
|
<!-- *ngFor w/ hero-detail Component -->
|
||||||
<!-- #docregion Template-3a -->
|
<!-- #docregion Template-3a -->
|
||||||
<hero-detail *ngFor="#hero of heroes; trackBy:trackByHeroes" [hero]="hero"></hero-detail>
|
<hero-detail *ngFor="let hero of heroes; trackBy:trackByHeroes" [hero]="hero"></hero-detail>
|
||||||
<!-- #enddocregion Template-3a -->
|
<!-- #enddocregion Template-3a -->
|
||||||
|
|
||||||
<p><i>expand to template = "..."</i></p>
|
<p><i>expand to template = "..."</i></p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- *ngFor w/ hero-detail Component and a template "attribute" directive -->
|
<!-- *ngFor w/ hero-detail Component and a template "attribute" directive -->
|
||||||
<!-- #docregion Template-3 -->
|
<!-- #docregion Template-3 -->
|
||||||
<hero-detail template="ngFor #hero of heroes; trackBy:trackByHeroes" [hero]="hero"></hero-detail>
|
<hero-detail template="ngFor let hero of heroes; trackBy:trackByHeroes" [hero]="hero"></hero-detail>
|
||||||
<!-- #enddocregion Template-3 -->
|
<!-- #enddocregion Template-3 -->
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
@ -644,7 +644,7 @@ bindon-ngModel
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- ngFor w/ hero-detail Component inside a template element -->
|
<!-- ngFor w/ hero-detail Component inside a template element -->
|
||||||
<!-- #docregion Template-4 -->
|
<!-- #docregion Template-4 -->
|
||||||
<template ngFor #hero [ngForOf]="heroes" [ngForTrackBy]="trackByHeroes">
|
<template ngFor let-hero [ngForOf]="heroes" [ngForTrackBy]="trackByHeroes">
|
||||||
<hero-detail [hero]="hero"></hero-detail>
|
<hero-detail [hero]="hero"></hero-detail>
|
||||||
</template>
|
</template>
|
||||||
<!-- #enddocregion Template-4 -->
|
<!-- #enddocregion Template-4 -->
|
||||||
|
|
|
@ -519,7 +519,7 @@ After setClasses(), the classes are "{{classDiv.className}}"
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- #docregion NgFor-1 -->
|
<!-- #docregion NgFor-1 -->
|
||||||
<div *ngFor="#hero of heroes">{{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes">{{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgFor-1 -->
|
<!-- #enddocregion NgFor-1 -->
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
@ -527,7 +527,7 @@ After setClasses(), the classes are "{{classDiv.className}}"
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- *ngFor w/ hero-detail Component -->
|
<!-- *ngFor w/ hero-detail Component -->
|
||||||
<!-- #docregion NgFor-2 -->
|
<!-- #docregion NgFor-2 -->
|
||||||
<hero-detail *ngFor="#hero of heroes" [hero]="hero"></hero-detail>
|
<hero-detail *ngFor="let hero of heroes" [hero]="hero"></hero-detail>
|
||||||
<!-- #enddocregion NgFor-2 -->
|
<!-- #enddocregion NgFor-2 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -537,14 +537,14 @@ After setClasses(), the classes are "{{classDiv.className}}"
|
||||||
<p>with <i>semi-colon</i> separator</p>
|
<p>with <i>semi-colon</i> separator</p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- #docregion NgFor-3 -->
|
<!-- #docregion NgFor-3 -->
|
||||||
<div *ngFor="#hero of heroes; #i=index">{{i + 1}} - {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes; let i=index">{{i + 1}} - {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgFor-3 -->
|
<!-- #enddocregion NgFor-3 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>with <i>comma</i> separator</p>
|
<p>with <i>comma</i> separator</p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- Ex: "1 - Hercules Son of Zeus"" -->
|
<!-- Ex: "1 - Hercules Son of Zeus"" -->
|
||||||
<div *ngFor="#hero of heroes, #i=index">{{i + 1}} - {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes, let i=index">{{i + 1}} - {{hero.fullName}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a class="to-toc" href="#toc">top</a>
|
<a class="to-toc" href="#toc">top</a>
|
||||||
|
@ -556,7 +556,7 @@ After setClasses(), the classes are "{{classDiv.className}}"
|
||||||
<p><i>without</i> trackBy</p>
|
<p><i>without</i> trackBy</p>
|
||||||
<div #noTrackBy class="box">
|
<div #noTrackBy class="box">
|
||||||
<!-- #docregion NgForTrackBy-1 -->
|
<!-- #docregion NgForTrackBy-1 -->
|
||||||
<div *ngFor="#hero of heroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgForTrackBy-1 -->
|
<!-- #enddocregion NgForTrackBy-1 -->
|
||||||
</div>
|
</div>
|
||||||
<div id="noTrackByCnt" *ngIf="heroesNoTrackByChangeCount" style="background-color:bisque">
|
<div id="noTrackByCnt" *ngIf="heroesNoTrackByChangeCount" style="background-color:bisque">
|
||||||
|
@ -566,7 +566,7 @@ After setClasses(), the classes are "{{classDiv.className}}"
|
||||||
<p>with trackBy and <i>semi-colon</i> separator</p>
|
<p>with trackBy and <i>semi-colon</i> separator</p>
|
||||||
<div #withTrackBy class="box">
|
<div #withTrackBy class="box">
|
||||||
<!-- #docregion NgForTrackBy-2 -->
|
<!-- #docregion NgForTrackBy-2 -->
|
||||||
<div *ngFor="#hero of heroes; trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes; trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgForTrackBy-2 -->
|
<!-- #enddocregion NgForTrackBy-2 -->
|
||||||
</div>
|
</div>
|
||||||
<div id="withTrackByCnt" *ngIf="heroesWithTrackByChangeCount" style="background-color:bisque">
|
<div id="withTrackByCnt" *ngIf="heroesWithTrackByChangeCount" style="background-color:bisque">
|
||||||
|
@ -575,25 +575,25 @@ After setClasses(), the classes are "{{classDiv.className}}"
|
||||||
|
|
||||||
<p>with trackBy and <i>comma</i> separator</p>
|
<p>with trackBy and <i>comma</i> separator</p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div *ngFor="#hero of heroes, trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes, trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>with trackBy and <i>space</i> separator</p>
|
<p>with trackBy and <i>space</i> separator</p>
|
||||||
<div #withTrackBy class="box">
|
<div #withTrackBy class="box">
|
||||||
<div *ngFor="#hero of heroes trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes trackBy:trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>with <i>*ngForTrackBy</i></p>
|
<p>with <i>*ngForTrackBy</i></p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- #docregion NgForTrackBy-2 -->
|
<!-- #docregion NgForTrackBy-2 -->
|
||||||
<div *ngFor="#hero of heroes" *ngForTrackBy="trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes" *ngForTrackBy="trackByHeroes">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgForTrackBy-2 -->
|
<!-- #enddocregion NgForTrackBy-2 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>with <i>generic</i> trackById function</p>
|
<p>with <i>generic</i> trackById function</p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- #docregion NgForTrackBy-3 -->
|
<!-- #docregion NgForTrackBy-3 -->
|
||||||
<div *ngFor="#hero of heroes" *ngForTrackBy="trackById">({{hero.id}}) {{hero.fullName}}</div>
|
<div *ngFor="let hero of heroes" *ngForTrackBy="trackById">({{hero.id}}) {{hero.fullName}}</div>
|
||||||
<!-- #enddocregion NgForTrackBy-3 -->
|
<!-- #enddocregion NgForTrackBy-3 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -624,14 +624,14 @@ After setClasses(), the classes are "{{classDiv.className}}"
|
||||||
<p><i>*ngFor</i></p>
|
<p><i>*ngFor</i></p>
|
||||||
<!-- *ngFor w/ hero-detail Component -->
|
<!-- *ngFor w/ hero-detail Component -->
|
||||||
<!-- #docregion Template-3a -->
|
<!-- #docregion Template-3a -->
|
||||||
<hero-detail *ngFor="#hero of heroes; trackBy:trackByHeroes" [hero]="hero"></hero-detail>
|
<hero-detail *ngFor="let hero of heroes; trackBy:trackByHeroes" [hero]="hero"></hero-detail>
|
||||||
<!-- #enddocregion Template-3a -->
|
<!-- #enddocregion Template-3a -->
|
||||||
|
|
||||||
<p><i>expand to template = "..."</i></p>
|
<p><i>expand to template = "..."</i></p>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- ngFor w/ hero-detail Component and a template "attribute" directive -->
|
<!-- ngFor w/ hero-detail Component and a template "attribute" directive -->
|
||||||
<!-- #docregion Template-3 -->
|
<!-- #docregion Template-3 -->
|
||||||
<hero-detail template="ngFor #hero of heroes; trackBy:trackByHeroes" [hero]="hero"></hero-detail>
|
<hero-detail template="ngFor let hero of heroes; trackBy:trackByHeroes" [hero]="hero"></hero-detail>
|
||||||
<!-- #enddocregion Template-3 -->
|
<!-- #enddocregion Template-3 -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -639,7 +639,7 @@ After setClasses(), the classes are "{{classDiv.className}}"
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<!-- ngFor w/ hero-detail Component inside a template element -->
|
<!-- ngFor w/ hero-detail Component inside a template element -->
|
||||||
<!-- #docregion Template-4 -->
|
<!-- #docregion Template-4 -->
|
||||||
<template ngFor #hero [ngForOf]="heroes" [ngForTrackBy]="trackByHeroes">
|
<template ngFor let-hero [ngForOf]="heroes" [ngForTrackBy]="trackByHeroes">
|
||||||
<hero-detail [hero]="hero"></hero-detail>
|
<hero-detail [hero]="hero"></hero-detail>
|
||||||
</template>
|
</template>
|
||||||
<!-- #enddocregion Template-4 -->
|
<!-- #enddocregion Template-4 -->
|
||||||
|
@ -650,31 +650,31 @@ After setClasses(), the classes are "{{classDiv.className}}"
|
||||||
<!-- template local variable -->
|
<!-- template local variable -->
|
||||||
<hr><h2 id="local-vars">Template local variables</h2>
|
<hr><h2 id="local-vars">Template local variables</h2>
|
||||||
|
|
||||||
<!-- #docregion var-phone -->
|
<!-- #docregion ref-phone -->
|
||||||
<!-- phone refers to the input element; pass its `value` to an event handler -->
|
<!-- phone refers to the input element; pass its `value` to an event handler -->
|
||||||
<input #phone placeholder="phone number">
|
<input #phone placeholder="phone number">
|
||||||
<button (click)="callPhone(phone.value)">Call</button>
|
<button (click)="callPhone(phone.value)">Call</button>
|
||||||
|
|
||||||
<!-- fax refers to the input element; pass its `value` to an event handler -->
|
<!-- fax refers to the input element; pass its `value` to an event handler -->
|
||||||
<input var-fax placeholder="fax number">
|
<input ref-fax placeholder="fax number">
|
||||||
<button (click)="callFax(fax.value)">Fax</button>
|
<button (click)="callFax(fax.value)">Fax</button>
|
||||||
<!-- #enddocregion var-phone -->
|
<!-- #enddocregion ref-phone -->
|
||||||
|
|
||||||
<h4>Example Form</h4>
|
<h4>Example Form</h4>
|
||||||
<!-- #docregion var-form -->
|
<!-- #docregion ref-form -->
|
||||||
<!-- #docregion var-form-a -->
|
<!-- #docregion ref-form-a -->
|
||||||
<form (ngSubmit)="onSubmit(theForm)" #theForm="ngForm">
|
<form (ngSubmit)="onSubmit(theForm)" #theForm="ngForm">
|
||||||
<!-- #enddocregion var-form-a -->
|
<!-- #enddocregion ref-form-a -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="name">Name</label>
|
<label for="name">Name</label>
|
||||||
<input class="form-control" required ngControl="firstName"
|
<input class="form-control" required ngControl="firstName"
|
||||||
[(ngModel)]="currentHero.firstName">
|
[(ngModel)]="currentHero.firstName">
|
||||||
</div>
|
</div>
|
||||||
<!-- #docregion var-form-a -->
|
<!-- #docregion ref-form-a -->
|
||||||
<button type="submit" [disabled]="!theForm.form.valid">Submit</button>
|
<button type="submit" [disabled]="!theForm.form.valid">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
<!-- #enddocregion var-form-a -->
|
<!-- #enddocregion ref-form-a -->
|
||||||
<!-- #enddocregion var-form -->
|
<!-- #enddocregion ref-form -->
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<!-- btn refers to the button element; show its disabled state -->
|
<!-- btn refers to the button element; show its disabled state -->
|
||||||
|
|
|
@ -160,7 +160,7 @@ export class BadTemplateUrl { }
|
||||||
<label>Child value: <input [(ngModel)]="childValue"> </label>
|
<label>Child value: <input [(ngModel)]="childValue"> </label>
|
||||||
</div>
|
</div>
|
||||||
<p><i>Change log:</i></p>
|
<p><i>Change log:</i></p>
|
||||||
<div *ngFor="#log of changeLog; #i=index">{{i + 1}} - {{log}}</div>`
|
<div *ngFor="let log of changeLog; let i=index">{{i + 1}} - {{log}}</div>`
|
||||||
})
|
})
|
||||||
export class MyIfChildComp implements OnInit, OnChanges, OnDestroy {
|
export class MyIfChildComp implements OnInit, OnChanges, OnDestroy {
|
||||||
@Input() value = '';
|
@Input() value = '';
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<h3>Top Heroes</h3>
|
<h3>Top Heroes</h3>
|
||||||
<div class="grid grid-pad">
|
<div class="grid grid-pad">
|
||||||
<!-- #docregion click -->
|
<!-- #docregion click -->
|
||||||
<div *ngFor="#hero of heroes" (click)="gotoDetail(hero)" class="col-1-4">
|
<div *ngFor="let hero of heroes" (click)="gotoDetail(hero)" class="col-1-4">
|
||||||
<!-- #enddocregion click -->
|
<!-- #enddocregion click -->
|
||||||
<div class="module hero">
|
<div class="module hero">
|
||||||
<h4>{{hero.name}}</h4>
|
<h4>{{hero.name}}</h4>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
[class.selected]="hero === selectedHero"
|
[class.selected]="hero === selectedHero"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// #docregion ng-for
|
// #docregion ng-for
|
||||||
<li *ngFor="#hero of heroes">
|
<li *ngFor="let hero of heroes">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
</li>
|
</li>
|
||||||
// #enddocregion ng-for
|
// #enddocregion ng-for
|
||||||
|
@ -7,14 +7,14 @@
|
||||||
// #docregion heroes-styled
|
// #docregion heroes-styled
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes">
|
<li *ngFor="let hero of heroes">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
// #enddocregion heroes-styled
|
// #enddocregion heroes-styled
|
||||||
|
|
||||||
// #docregion selectedHero-click
|
// #docregion selectedHero-click
|
||||||
<li *ngFor="#hero of heroes" (click)="onSelect(hero)">
|
<li *ngFor="let hero of heroes" (click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
</li>
|
</li>
|
||||||
// #enddocregion selectedHero-click
|
// #enddocregion selectedHero-click
|
||||||
|
@ -53,7 +53,7 @@ public heroes = HEROES;
|
||||||
// #enddocregion heroes-template-1
|
// #enddocregion heroes-template-1
|
||||||
|
|
||||||
// #docregion heroes-ngfor-1
|
// #docregion heroes-ngfor-1
|
||||||
<li *ngFor="#hero of heroes">
|
<li *ngFor="let hero of heroes">
|
||||||
// #enddocregion heroes-ngfor-1
|
// #enddocregion heroes-ngfor-1
|
||||||
|
|
||||||
// #docregion class-selected-1
|
// #docregion class-selected-1
|
||||||
|
@ -61,7 +61,7 @@ public heroes = HEROES;
|
||||||
// #enddocregion class-selected-1
|
// #enddocregion class-selected-1
|
||||||
|
|
||||||
// #docregion class-selected-2
|
// #docregion class-selected-2
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
[class.selected]="hero === selectedHero"
|
[class.selected]="hero === selectedHero"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class Hero {
|
||||||
<h1>{{title}}</h1>
|
<h1>{{title}}</h1>
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
[class.selected]="hero === selectedHero"
|
[class.selected]="hero === selectedHero"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {HeroDetailComponent} from './hero-detail.component';
|
||||||
<h1>{{title}}</h1>
|
<h1>{{title}}</h1>
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
[class.selected]="hero === selectedHero"
|
[class.selected]="hero === selectedHero"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {HeroService} from './hero.service.1';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'my-app',
|
||||||
template: `
|
template: `
|
||||||
<div *ngFor="#hero of heroes" (click)="onSelect(hero)">
|
<div *ngFor="let hero of heroes" (click)="onSelect(hero)">
|
||||||
{{hero.name}}
|
{{hero.name}}
|
||||||
</div>
|
</div>
|
||||||
<my-hero-detail [hero]="selectedHero"></my-hero-detail>
|
<my-hero-detail [hero]="selectedHero"></my-hero-detail>
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {HeroService} from './hero.service';
|
||||||
<h1>{{title}}</h1>
|
<h1>{{title}}</h1>
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
[class.selected]="hero === selectedHero"
|
[class.selected]="hero === selectedHero"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<h3>Top Heroes</h3>
|
<h3>Top Heroes</h3>
|
||||||
<div class="grid grid-pad">
|
<div class="grid grid-pad">
|
||||||
<!-- #docregion click -->
|
<!-- #docregion click -->
|
||||||
<div *ngFor="#hero of heroes" (click)="gotoDetail(hero)" class="col-1-4" >
|
<div *ngFor="let hero of heroes" (click)="gotoDetail(hero)" class="col-1-4" >
|
||||||
<!-- #enddocregion click -->
|
<!-- #enddocregion click -->
|
||||||
<div class="module hero">
|
<div class="module hero">
|
||||||
<h4>{{hero.name}}</h4>
|
<h4>{{hero.name}}</h4>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
[class.selected]="hero === selectedHero"
|
[class.selected]="hero === selectedHero"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<h3>Top Heroes</h3>
|
<h3>Top Heroes</h3>
|
||||||
<div class="grid grid-pad">
|
<div class="grid grid-pad">
|
||||||
<!-- #docregion click -->
|
<!-- #docregion click -->
|
||||||
<div *ngFor="#hero of heroes" (click)="gotoDetail(hero)" class="col-1-4">
|
<div *ngFor="let hero of heroes" (click)="gotoDetail(hero)" class="col-1-4">
|
||||||
<!-- #enddocregion click -->
|
<!-- #enddocregion click -->
|
||||||
<div class="module hero">
|
<div class="module hero">
|
||||||
<h4>{{hero.name}}</h4>
|
<h4>{{hero.name}}</h4>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
[class.selected]="hero === selectedHero"
|
[class.selected]="hero === selectedHero"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<h3>Top Heroes</h3>
|
<h3>Top Heroes</h3>
|
||||||
<div class="grid grid-pad">
|
<div class="grid grid-pad">
|
||||||
<div *ngFor="#hero of heroes" class="col-1-4" (click)="gotoDetail(hero)">
|
<div *ngFor="let hero of heroes" class="col-1-4" (click)="gotoDetail(hero)">
|
||||||
<div class="module hero">
|
<div class="module hero">
|
||||||
<h4>{{hero.name}}</h4>
|
<h4>{{hero.name}}</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div>
|
<div>
|
||||||
<h2>My Heroes</h2>
|
<h2>My Heroes</h2>
|
||||||
<ul class="heroes">
|
<ul class="heroes">
|
||||||
<li *ngFor="#hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
[class.selected]="hero === selectedHero"
|
[class.selected]="hero === selectedHero"
|
||||||
(click)="onSelect(hero)">
|
(click)="onSelect(hero)">
|
||||||
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
<span class="badge">{{hero.id}}</span> {{hero.name}}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"ambientDependencies": {
|
"ambientDependencies": {
|
||||||
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
|
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
|
||||||
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
|
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
<div class="phone-images">
|
<div class="phone-images">
|
||||||
<img [src]="img"
|
<img [src]="img"
|
||||||
class="phone"
|
class="phone"
|
||||||
*ngFor="#img of phone?.images"
|
*ngFor="let img of phone?.images"
|
||||||
[ngClass]="{active: mainImageUrl==img}">
|
[ngClass]="{active: mainImageUrl==img}">
|
||||||
</div>
|
</div>
|
||||||
<h1>{{phone?.name}}</h1>
|
<h1>{{phone?.name}}</h1>
|
||||||
<p>{{phone?.description}}</p>
|
<p>{{phone?.description}}</p>
|
||||||
<ul class="phone-thumbs">
|
<ul class="phone-thumbs">
|
||||||
<li *ngFor="#img of phone?.images">
|
<li *ngFor="let img of phone?.images">
|
||||||
<img [src]="img" (click)="setImage(img)">
|
<img [src]="img" (click)="setImage(img)">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<span>Availability and Networks</span>
|
<span>Availability and Networks</span>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Availability</dt>
|
<dt>Availability</dt>
|
||||||
<dd *ngFor="#availability of phone?.availability">{{availability}}</dd>
|
<dd *ngFor="let availability of phone?.availability">{{availability}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
<span>Size and Weight</span>
|
<span>Size and Weight</span>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Dimensions</dt>
|
<dt>Dimensions</dt>
|
||||||
<dd *ngFor="#dim of phone?.sizeAndWeight?.dimensions">{{dim}}</dd>
|
<dd *ngFor="let dim of phone?.sizeAndWeight?.dimensions">{{dim}}</dd>
|
||||||
<dt>Weight</dt>
|
<dt>Weight</dt>
|
||||||
<dd>{{phone?.sizeAndWeight?.weight}}</dd>
|
<dd>{{phone?.sizeAndWeight?.weight}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<!-- #docregion list -->
|
<!-- #docregion list -->
|
||||||
<ul class="phones">
|
<ul class="phones">
|
||||||
<li *ngFor="#phone of phones | async | phoneFilter:query | orderBy:orderProp"
|
<li *ngFor="let phone of phones | async | phoneFilter:query | orderBy:orderProp"
|
||||||
class="thumbnail phone-listing">
|
class="thumbnail phone-listing">
|
||||||
<a href="#/phones/{{phone.id}}" class="thumb"><img [src]="phone.imageUrl"></a>
|
<a href="#/phones/{{phone.id}}" class="thumb"><img [src]="phone.imageUrl"></a>
|
||||||
<a href="#/phones/{{phone.id}}" class="name">{{phone.name}}</a>
|
<a href="#/phones/{{phone.id}}" class="name">{{phone.name}}</a>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<!-- #docregion list -->
|
<!-- #docregion list -->
|
||||||
<ul class="phones">
|
<ul class="phones">
|
||||||
<li *ngFor="#phone of phones | phoneFilter:query | orderBy:orderProp"
|
<li *ngFor="let phone of phones | phoneFilter:query | orderBy:orderProp"
|
||||||
class="thumbnail phone-listing">
|
class="thumbnail phone-listing">
|
||||||
<a href="#/phones/{{phone.id}}" class="thumb"><img [src]="phone.imageUrl"></a>
|
<a href="#/phones/{{phone.id}}" class="thumb"><img [src]="phone.imageUrl"></a>
|
||||||
<a href="#/phones/{{phone.id}}" class="name">{{phone.name}}</a>
|
<a href="#/phones/{{phone.id}}" class="name">{{phone.name}}</a>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<!-- #docregion list -->
|
<!-- #docregion list -->
|
||||||
<ul class="phones">
|
<ul class="phones">
|
||||||
<li *ngFor="#phone of phones | filter:query | orderBy:orderProp"
|
<li *ngFor="let phone of phones | filter:query | orderBy:orderProp"
|
||||||
class="thumbnail phone-listing">
|
class="thumbnail phone-listing">
|
||||||
<a href="#/phones/{{phone.id}}" class="thumb"><img [src]="phone.imageUrl"></a>
|
<a href="#/phones/{{phone.id}}" class="thumb"><img [src]="phone.imageUrl"></a>
|
||||||
<a href="#/phones/{{phone.id}}" class="name">{{phone.name}}</a>
|
<a href="#/phones/{{phone.id}}" class="name">{{phone.name}}</a>
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
<div class="phone-images">
|
<div class="phone-images">
|
||||||
<img [src]="img"
|
<img [src]="img"
|
||||||
class="phone"
|
class="phone"
|
||||||
*ngFor="#img of phone?.images"
|
*ngFor="let img of phone?.images"
|
||||||
[ngClass]="{active: mainImageUrl==img}">
|
[ngClass]="{active: mainImageUrl==img}">
|
||||||
</div>
|
</div>
|
||||||
<h1>{{phone?.name}}</h1>
|
<h1>{{phone?.name}}</h1>
|
||||||
<p>{{phone?.description}}</p>
|
<p>{{phone?.description}}</p>
|
||||||
<ul class="phone-thumbs">
|
<ul class="phone-thumbs">
|
||||||
<li *ngFor="#img of phone?.images">
|
<li *ngFor="let img of phone?.images">
|
||||||
<img [src]="img" (click)="setImage(img)">
|
<img [src]="img" (click)="setImage(img)">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<span>Availability and Networks</span>
|
<span>Availability and Networks</span>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Availability</dt>
|
<dt>Availability</dt>
|
||||||
<dd *ngFor="#availability of phone?.availability">{{availability}}</dd>
|
<dd *ngFor="let availability of phone?.availability">{{availability}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
<span>Size and Weight</span>
|
<span>Size and Weight</span>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Dimensions</dt>
|
<dt>Dimensions</dt>
|
||||||
<dd *ngFor="#dim of phone?.sizeAndWeight?.dimensions">{{dim}}</dd>
|
<dd *ngFor="let dim of phone?.sizeAndWeight?.dimensions">{{dim}}</dd>
|
||||||
<dt>Weight</dt>
|
<dt>Weight</dt>
|
||||||
<dd>{{phone?.sizeAndWeight?.weight}}</dd>
|
<dd>{{phone?.sizeAndWeight?.weight}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<!-- #docregion list -->
|
<!-- #docregion list -->
|
||||||
<ul class="phones">
|
<ul class="phones">
|
||||||
<li *ngFor="#phone of phones | async | phoneFilter:query | orderBy:orderProp"
|
<li *ngFor="let phone of phones | async | phoneFilter:query | orderBy:orderProp"
|
||||||
class="thumbnail phone-listing">
|
class="thumbnail phone-listing">
|
||||||
<a [routerLink]="['/Phone', {phoneId: phone.id}]" class="thumb"><img [src]="phone.imageUrl"></a>
|
<a [routerLink]="['/Phone', {phoneId: phone.id}]" class="thumb"><img [src]="phone.imageUrl"></a>
|
||||||
<a [routerLink]="['/Phone', {phoneId: phone.id}]" class="name">{{phone.name}}</a>
|
<a [routerLink]="['/Phone', {phoneId: phone.id}]" class="name">{{phone.name}}</a>
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {Component} from 'angular2/core';
|
||||||
|
|
||||||
<button (click)=addHero(newHero.value)>Add</button>
|
<button (click)=addHero(newHero.value)>Add</button>
|
||||||
|
|
||||||
<ul><li *ngFor="#hero of heroes">{{hero}}</li></ul>
|
<ul><li *ngFor="let hero of heroes">{{hero}}</li></ul>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class LittleTourComponent {
|
export class LittleTourComponent {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"icon": "home",
|
"icon": "home",
|
||||||
"title": "Angular Docs",
|
"title": "Angular Docs",
|
||||||
"menuTitle": "Docs Home",
|
"menuTitle": "Docs Home",
|
||||||
"banner": "Welcome to <b>Angular in JavaScript</b>! The current Angular 2 release is <b>beta.16</b>. Please consult the <a href='https://github.com/angular/angular/blob/master/CHANGELOG.md' target='_blank'> Change Log</a> about recent enhancements, fixes, and breaking changes."
|
"banner": "Welcome to <b>Angular in JavaScript</b>! The current Angular 2 release is <b>beta.17</b>. Please consult the <a href='https://github.com/angular/angular/blob/master/CHANGELOG.md' target='_blank'> Change Log</a> about recent enhancements, fixes, and breaking changes."
|
||||||
},
|
},
|
||||||
|
|
||||||
"quickstart": {
|
"quickstart": {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"icon": "home",
|
"icon": "home",
|
||||||
"title": "Angular Docs",
|
"title": "Angular Docs",
|
||||||
"menuTitle": "Docs Home",
|
"menuTitle": "Docs Home",
|
||||||
"banner": "Welcome to <b>Angular in TypeScript</b>! The current Angular 2 release is <b>beta.16</b>. Please consult the <a href='https://github.com/angular/angular/blob/master/CHANGELOG.md' target='_blank'> Change Log</a> about recent enhancements, fixes, and breaking changes."
|
"banner": "Welcome to <b>Angular in TypeScript</b>! The current Angular 2 release is <b>beta.17</b>. Please consult the <a href='https://github.com/angular/angular/blob/master/CHANGELOG.md' target='_blank'> Change Log</a> about recent enhancements, fixes, and breaking changes."
|
||||||
},
|
},
|
||||||
|
|
||||||
"quickstart": {
|
"quickstart": {
|
||||||
|
|
|
@ -41,52 +41,52 @@ var _rxData = [
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/angular2/bundles/angular2.dev.js',
|
from: 'node_modules/angular2/bundles/angular2.dev.js',
|
||||||
to: 'https://code.angularjs.org/2.0.0-beta.16/angular2.dev.js'
|
to: 'https://code.angularjs.org/2.0.0-beta.17/angular2.dev.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/angular2/bundles/angular2-all.umd.dev.js',
|
from: 'node_modules/angular2/bundles/angular2-all.umd.dev.js',
|
||||||
to: 'https://code.angularjs.org/2.0.0-beta.16/angular2-all.umd.dev.js'
|
to: 'https://code.angularjs.org/2.0.0-beta.17/angular2-all.umd.dev.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/angular2/bundles/angular2-all.umd.js',
|
from: 'node_modules/angular2/bundles/angular2-all.umd.js',
|
||||||
to: 'https://code.angularjs.org/2.0.0-beta.16/angular2-all.umd.dev.js'
|
to: 'https://code.angularjs.org/2.0.0-beta.17/angular2-all.umd.dev.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/angular2/bundles/angular2-polyfills.js',
|
from: 'node_modules/angular2/bundles/angular2-polyfills.js',
|
||||||
to: 'https://code.angularjs.org/2.0.0-beta.16/angular2-polyfills.js'
|
to: 'https://code.angularjs.org/2.0.0-beta.17/angular2-polyfills.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/rxjs/bundles/Rx.js',
|
from: 'node_modules/rxjs/bundles/Rx.js',
|
||||||
to: 'https://code.angularjs.org/2.0.0-beta.16/Rx.js'
|
to: 'https://code.angularjs.org/2.0.0-beta.17/Rx.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/rxjs/bundles/Rx.umd.js',
|
from: 'node_modules/rxjs/bundles/Rx.umd.js',
|
||||||
to: 'https://code.angularjs.org/2.0.0-beta.16/Rx.umd.js'
|
to: 'https://code.angularjs.org/2.0.0-beta.17/Rx.umd.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/angular2/bundles/router.dev.js',
|
from: 'node_modules/angular2/bundles/router.dev.js',
|
||||||
to: 'https://code.angularjs.org/2.0.0-beta.16/router.dev.js'
|
to: 'https://code.angularjs.org/2.0.0-beta.17/router.dev.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/angular2/bundles/http.dev.js',
|
from: 'node_modules/angular2/bundles/http.dev.js',
|
||||||
to: 'https://code.angularjs.org/2.0.0-beta.16/http.dev.js'
|
to: 'https://code.angularjs.org/2.0.0-beta.17/http.dev.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/angular2/bundles/testing.dev.js',
|
from: 'node_modules/angular2/bundles/testing.dev.js',
|
||||||
to: 'https://code.angularjs.org/2.0.0-beta.16/testing.dev.js'
|
to: 'https://code.angularjs.org/2.0.0-beta.17/testing.dev.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
from: 'node_modules/angular2/es6/dev/src/testing/shims_for_IE.js',
|
from: 'node_modules/angular2/es6/dev/src/testing/shims_for_IE.js',
|
||||||
to: 'https://npmcdn.com/angular2@2.0.0-beta.16/es6/dev/src/testing/shims_for_IE.js'
|
to: 'https://npmcdn.com/angular2@2.0.0-beta.17/es6/dev/src/testing/shims_for_IE.js'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'script',
|
pattern: 'script',
|
||||||
|
|
Loading…
Reference in New Issue