docs(core): fix broken NgZone code example (#19291)

The current code example was broken as there were a couple of syntax errors. This commit fixes the demo.

PR Close #19291
This commit is contained in:
Juri Strumpflohner 2017-09-20 15:17:38 +02:00 committed by Miško Hevery
parent 330bb2a360
commit 6293ca23c3

View File

@ -31,7 +31,7 @@ import {EventEmitter} from '../event_emitter';
* import {NgIf} from '@angular/common'; * import {NgIf} from '@angular/common';
* *
* @Component({ * @Component({
* selector: 'ng-zone-demo'. * selector: 'ng-zone-demo',
* template: ` * template: `
* <h2>Demo: NgZone</h2> * <h2>Demo: NgZone</h2>
* *
@ -63,9 +63,10 @@ import {EventEmitter} from '../event_emitter';
* this.progress = 0; * this.progress = 0;
* this._ngZone.runOutsideAngular(() => { * this._ngZone.runOutsideAngular(() => {
* this._increaseProgress(() => { * this._increaseProgress(() => {
* // reenter the Angular zone and display done * // reenter the Angular zone and display done
* this._ngZone.run(() => {console.log('Outside Done!') }); * this._ngZone.run(() => { console.log('Outside Done!'); });
* }})); * });
* });
* } * }
* *
* _increaseProgress(doneCallback: () => void) { * _increaseProgress(doneCallback: () => void) {
@ -73,7 +74,7 @@ import {EventEmitter} from '../event_emitter';
* console.log(`Current progress: ${this.progress}%`); * console.log(`Current progress: ${this.progress}%`);
* *
* if (this.progress < 100) { * if (this.progress < 100) {
* window.setTimeout(() => this._increaseProgress(doneCallback)), 10) * window.setTimeout(() => this._increaseProgress(doneCallback), 10);
* } else { * } else {
* doneCallback(); * doneCallback();
* } * }