mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
Access parent nav in view
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import {NgElement, Component, Template} from 'angular2/angular2'
|
||||
import {NgElement, Component, Template, Parent} from 'angular2/angular2'
|
||||
import {Toolbar} from 'ionic2/components/toolbar/toolbar'
|
||||
import {NavView} from 'ionic2/components/nav-view/nav-view'
|
||||
|
||||
@Component({
|
||||
selector: 'ion-view',
|
||||
@ -20,8 +21,8 @@ import {Toolbar} from 'ionic2/components/toolbar/toolbar'
|
||||
directives: [Toolbar]
|
||||
})
|
||||
export class View {
|
||||
constructor(@NgElement() ele:NgElement) {
|
||||
constructor(@NgElement() ele:NgElement, @Parent() nav: NavView) {
|
||||
ele.domElement.classList.add('pane')
|
||||
console.log('View constructed', ele.domElement);
|
||||
console.log('View constructed', ele.domElement, nav);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user