diff --git a/modules/angular2/examples/core/pipes/ts/async_pipe/async_pipe_example.ts b/modules/angular2/examples/core/pipes/ts/async_pipe/async_pipe_example.ts index 89c8342dd7..3cb7e93d5e 100644 --- a/modules/angular2/examples/core/pipes/ts/async_pipe/async_pipe_example.ts +++ b/modules/angular2/examples/core/pipes/ts/async_pipe/async_pipe_example.ts @@ -5,28 +5,29 @@ import {bootstrap} from 'angular2/bootstrap'; @Component({ selector: 'async-example', template: `
-

Wait for it... {{promise | async}}

- +

Wait for it... {{ greeting | async }}

+
` }) export class AsyncPipeExample { - resolved: boolean = false; - promise: Promise = null; - resolve: Function = null; + greeting: Promise = null; + arrived: boolean = false; + + private resolve: Function = null; constructor() { this.reset(); } reset() { - this.resolved = false; - this.promise = new Promise((resolve, reject) => { this.resolve = resolve; }); + this.arrived = false; + this.greeting = new Promise((resolve, reject) => { this.resolve = resolve; }); } clicked() { - if (this.resolved) { + if (this.arrived) { this.reset(); } else { - this.resolve("resolved!"); - this.resolved = true; + this.resolve("hi there!"); + this.arrived = true; } } }