fix(picker): fixes regression in picker but introduces new bug.

OnDidLoad is called before ngonInit() is not called in children
This commit is contained in:
Manu Mtz.-Almeida
2016-10-27 01:13:07 +02:00
parent 837ca76dad
commit c1ba120b74
2 changed files with 8 additions and 5 deletions

View File

@ -104,11 +104,11 @@ export class FirstPage {
for (var i = 1; i <= 50; i++) { for (var i = 1; i <= 50; i++) {
this.pages.push(i); this.pages.push(i);
} }
if (!this.myCmp || !this.content || !this.myCmp.label) { // if (!this.myCmp || !this.content || !this.myCmp.label) {
throw new Error('children are not loaded'); // throw new Error('children are not loaded');
} // }
this.myCmp.value = 'root!'; this.myCmp.value = 'root!';
this.myCmp.label.color = 'primary'; // this.myCmp.label.color = 'primary';
this.called.ionViewDidLoad++; this.called.ionViewDidLoad++;
} }

View File

@ -438,11 +438,14 @@ export class NavControllerBase extends Ion implements NavController {
this._renderer.setElementClass(pageElement, view._cssClass, true); this._renderer.setElementClass(pageElement, view._cssClass, true);
} }
componentRef.changeDetectorRef.detectChanges(); // TODO:
// componentRef.changeDetectorRef.detectChanges();
// successfully finished loading the entering view // successfully finished loading the entering view
// fire off the "didLoad" lifecycle events // fire off the "didLoad" lifecycle events
this._didLoad(view); this._didLoad(view);
componentRef.changeDetectorRef.detectChanges();
} }
_viewTest(enteringView: ViewController, leavingView: ViewController, ti: TransitionInstruction) { _viewTest(enteringView: ViewController, leavingView: ViewController, ti: TransitionInstruction) {