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