ion-nav is the anchor

This commit is contained in:
Adam Bradley
2015-06-09 14:56:25 -05:00
parent 359ab9d5c1
commit 972411e1bf
3 changed files with 10 additions and 26 deletions

View File

@@ -8,22 +8,15 @@ import {DynamicComponentLoader} from 'angular2/src/core/compiler/dynamic_compone
import {Injector} from 'angular2/di';
import {ViewController} from '../view/view-controller';
import {IonicComponent} from '../../config/component';
@Component({
@Directive({
selector: 'ion-nav',
properties: [
'initial'
],
lifecycle: [onInit]
})
@View({
template: `
<template pane-anchor></template>
`,
directives: [NavPaneAnchor]
})
export class Nav extends ViewController {
constructor(
@@ -34,9 +27,7 @@ export class Nav extends ViewController {
injector: Injector
) {
super(viewController, compiler, elementRef, loader, injector);
this.domElement = elementRef.domElement;
this.config = Nav.config.invoke(this);
this.panes.setAnchor(elementRef);
}
onInit() {
@@ -44,14 +35,3 @@ export class Nav extends ViewController {
}
}
new IonicComponent(Nav, {});
@Directive({
selector: 'template[pane-anchor]'
})
class NavPaneAnchor {
constructor(@Parent() nav: Nav, elementRef: ElementRef) {
nav.panes.setAnchor(elementRef);
}
}

View File

@@ -92,9 +92,12 @@ export class PaneController {
}
@Component({selector:'ion-pane'})
@Component({
selector:'ion-pane',
hostAttributes: {
'class': 'nav nav-ios'
}
})
@View({
template: `
<template pane-anchor></template>
@@ -110,6 +113,7 @@ class Pane {
this.sections = {};
nav.panes.add(this);
}
addSection(sectionName, instance) {
this.sections[sectionName] = instance;
}

View File

@@ -12,7 +12,7 @@ export class ViewItem {
constructor(viewController, ComponentClass, params = {}) {
this.viewController = viewController;
this.ComponentClass = ComponentClass;
this.params = new NavParams(this.params);
this.params = new NavParams(params);
this.instance = null;
this.state = 0;