-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(angular): ngOnDestroy runs inside angular zone (#24949)
Resolves #22571
- Loading branch information
1 parent
9e84ef7
commit a8fd2d9
Showing
5 changed files
with
53 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
angular/test/test-app/src/app/nested-outlet-page/nested-outlet-page.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, NgZone, OnDestroy, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-nested-outlet-page', | ||
templateUrl: './nested-outlet-page.component.html', | ||
}) | ||
export class NestedOutletPageComponent { | ||
export class NestedOutletPageComponent implements OnDestroy, OnInit { | ||
|
||
ngOnInit() { | ||
NgZone.assertInAngularZone(); | ||
} | ||
|
||
ngOnDestroy() { | ||
NgZone.assertInAngularZone(); | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
angular/test/test-app/src/app/nested-outlet-page2/nested-outlet-page2.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<ion-content> | ||
<h1>Nested page 2</h1> | ||
<p> | ||
<ion-button routerLink="/nested-outlet/page">Go To FIRST</ion-button> | ||
</p> | ||
</ion-content> | ||
<h1>Nested page 2</h1> | ||
<p> | ||
<ion-button routerLink="/nested-outlet/page" id="goto-nested-page1">Go To FIRST</ion-button> | ||
</p> | ||
</ion-content> |
12 changes: 10 additions & 2 deletions
12
angular/test/test-app/src/app/nested-outlet-page2/nested-outlet-page2.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, NgZone, OnDestroy, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-nested-outlet-page2', | ||
templateUrl: './nested-outlet-page2.component.html', | ||
}) | ||
export class NestedOutletPage2Component { | ||
export class NestedOutletPage2Component implements OnDestroy, OnInit { | ||
|
||
ngOnInit() { | ||
NgZone.assertInAngularZone(); | ||
} | ||
|
||
ngOnDestroy() { | ||
NgZone.assertInAngularZone(); | ||
} | ||
} |