fix(angular): disable change detection detach

This commit is contained in:
Manu Mtz.-Almeida
2018-12-05 22:23:19 +01:00
committed by Manu MA
parent 945dd2610b
commit 68e26192a5
12 changed files with 71 additions and 24 deletions

View File

@@ -25,6 +25,9 @@ export class ModalExampleComponent implements OnInit {
}
ionViewWillEnter() {
if (this.onInit !== 1) {
throw new Error('ngOnInit was not called');
}
NgZone.assertInAngularZone();
this.willEnter++;
}

View File

@@ -3,11 +3,11 @@
<ion-buttons slot="start">
<ion-back-button></ion-back-button>
</ion-buttons>
<ion-title>router-link page</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
router-link page
<ion-content padding>
<p>ngOnInit: <span id="ngOnInit">{{onInit}}</span></p>
<p>ionViewWillEnter: <span id="ionViewWillEnter">{{willEnter}}</span></p>
<p>ionViewDidEnter: <span id="ionViewDidEnter">{{didEnter}}</span></p>

View File

@@ -18,6 +18,9 @@ export class RouterLinkPageComponent implements OnInit {
}
ionViewWillEnter() {
if (this.onInit !== 1) {
throw new Error('ngOnInit was not called');
}
NgZone.assertInAngularZone();
this.willEnter++;
}

View File

@@ -41,6 +41,9 @@ export class RouterLinkComponent implements OnInit {
}
ionViewWillEnter() {
if (this.onInit !== 1) {
throw new Error('ngOnInit was not called');
}
NgZone.assertInAngularZone();
this.willEnter++;
}

View File

@@ -1,14 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
@Component({
selector: 'app-tabs',
templateUrl: './tabs.component.html',
})
export class TabsComponent implements OnInit {
constructor() { }
ngOnInit() {
}
export class TabsComponent {
}