File tree Expand file tree Collapse file tree 2 files changed +8
-18
lines changed
packages/core/src/components/nav Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -619,14 +619,9 @@ export class NavControllerBase implements NavOutlet {
619
619
// render the component ref instance to the DOM
620
620
// ******** DOM WRITE ****************
621
621
this . el . appendChild ( view . element ) ;
622
+
622
623
view . _state = STATE_ATTACHED ;
623
624
624
- // TODO: fails in test
625
- if ( view . _cssClass ) {
626
- // the ElementRef of the actual ion-page created
627
- // ******** DOM WRITE ****************+
628
- view . element . classList . add ( view . _cssClass ) ;
629
- }
630
625
// successfully finished loading the entering view
631
626
// fire off the "didLoad" lifecycle events
632
627
view . _didLoad ( ) ;
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ export class ViewController {
30
30
_nav : NavControllerBase ;
31
31
_zIndex : number ;
32
32
_state : number = STATE_NEW ;
33
- _cssClass : string ;
34
33
35
34
/** @hidden */
36
35
id : string ;
@@ -44,15 +43,8 @@ export class ViewController {
44
43
45
44
constructor (
46
45
public component : any ,
47
- public data ?: any ,
48
- rootCssClass : string = DEFAULT_CSS_CLASS
49
- ) {
50
- // component could be anything, never use it directly
51
- // it could be a string, a HTMLElement
52
- // passed in data could be NavParams, but all we care about is its data object
53
- // this.data = (data instanceof NavParams ? data.data : (isPresent(data) ? data : {}));
54
- this . _cssClass = rootCssClass ;
55
- }
46
+ public data ?: any
47
+ ) { }
56
48
57
49
/**
58
50
* @hidden
@@ -65,6 +57,11 @@ export class ViewController {
65
57
this . element = ( typeof component === 'string' )
66
58
? document . createElement ( component )
67
59
: component ;
60
+
61
+ this . element . classList . add ( 'ion-page' ) ;
62
+ if ( this . data ) {
63
+ Object . assign ( this . element , this . data ) ;
64
+ }
68
65
}
69
66
70
67
_setNav ( navCtrl : NavControllerBase ) {
@@ -322,5 +319,3 @@ export class ViewController {
322
319
export function isViewController ( viewCtrl : any ) : viewCtrl is ViewController {
323
320
return ! ! ( viewCtrl && ( < ViewController > viewCtrl ) . _didLoad && ( < ViewController > viewCtrl ) . _willUnload ) ;
324
321
}
325
-
326
- const DEFAULT_CSS_CLASS = 'ion-page' ;
You can’t perform that action at this time.
0 commit comments