mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
i'm all about that base
This commit is contained in:
@ -1,12 +1,11 @@
|
||||
import {Parent} from 'angular2/src/core/annotations_impl/visibility';
|
||||
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||
import {Optional} from 'angular2/src/di/annotations_impl';
|
||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||
import {Optional} from 'angular2/src/di/annotations_impl';
|
||||
import {Parent} from 'angular2/src/core/annotations_impl/visibility';
|
||||
import {Compiler} from 'angular2/angular2';
|
||||
import {ElementRef} from 'angular2/src/core/compiler/element_ref';
|
||||
import {DynamicComponentLoader} from 'angular2/src/core/compiler/dynamic_component_loader';
|
||||
import {Injector} from 'angular2/di';
|
||||
import {ViewContainerRef} from 'angular2/src/core/compiler/view_container_ref';
|
||||
import {Compiler} from 'angular2/angular2';
|
||||
|
||||
import {NavBase} from './nav-base';
|
||||
import {IonicComponent} from '../../config/component';
|
||||
@ -25,31 +24,23 @@ import {IonicComponent} from '../../config/component';
|
||||
`,
|
||||
directives: [NavPaneAnchor]
|
||||
})
|
||||
export class Nav {
|
||||
export class Nav extends NavBase {
|
||||
|
||||
constructor(
|
||||
@Optional() parentNavBase: NavBase,
|
||||
compiler:Compiler,
|
||||
elementRef: ElementRef,
|
||||
loader: DynamicComponentLoader,
|
||||
injector: Injector
|
||||
) {
|
||||
this.navBase = new NavBase(parentNavBase, compiler, elementRef, loader, injector);
|
||||
@Optional() parentNavBase: NavBase,
|
||||
compiler: Compiler,
|
||||
elementRef: ElementRef,
|
||||
loader: DynamicComponentLoader,
|
||||
injector: Injector
|
||||
) {
|
||||
super(parentNavBase, compiler, elementRef, loader, injector);
|
||||
|
||||
this.domElement = elementRef.domElement;
|
||||
this.config = Nav.config.invoke(this);
|
||||
}
|
||||
|
||||
onInit() {
|
||||
this.navBase.initial(this.initial);
|
||||
}
|
||||
|
||||
setPaneAnchor(elementRef) {
|
||||
this.navBase.setPaneAnchor(elementRef);
|
||||
}
|
||||
|
||||
addPane(pane) {
|
||||
this.navBase.addPane(pane);
|
||||
this.push(this.initial);
|
||||
}
|
||||
|
||||
}
|
||||
@ -61,6 +52,6 @@ new IonicComponent(Nav, {});
|
||||
})
|
||||
class NavPaneAnchor {
|
||||
constructor(@Parent() nav: Nav, elementRef: ElementRef) {
|
||||
nav.navBase.setPaneAnchor(elementRef);
|
||||
nav.setPaneAnchor(elementRef);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user