From f21802ba87651ff6fa688171f32a07920533615c Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Sat, 27 Jun 2015 14:42:09 -0500 Subject: [PATCH] use injector instead of passing params --- ionic/components/nav/nav.js | 5 +---- ionic/components/tabs/tab.js | 4 +--- ionic/components/tabs/tabs.js | 5 +---- ionic/components/view/view-controller.js | 12 +++--------- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/ionic/components/nav/nav.js b/ionic/components/nav/nav.js index c9218fa3cc..429e46094a 100644 --- a/ionic/components/nav/nav.js +++ b/ionic/components/nav/nav.js @@ -25,12 +25,9 @@ export class Nav extends ViewController { constructor( @Optional() viewCtrl: ViewController, - compiler: Compiler, - elementRef: ElementRef, - loader: DynamicComponentLoader, injector: Injector ) { - super(viewCtrl, compiler, elementRef, loader, injector); + super(viewCtrl, injector); } onInit() { diff --git a/ionic/components/tabs/tab.js b/ionic/components/tabs/tab.js index 19fbbafd0b..c685f42df4 100644 --- a/ionic/components/tabs/tab.js +++ b/ionic/components/tabs/tab.js @@ -36,15 +36,13 @@ export class Tab extends ViewController { constructor( @Parent() tabs: Tabs, - compiler: Compiler, elementRef: ElementRef, - loader: DynamicComponentLoader, injector: Injector ) { // A Tab is both a container of many views, and is a view itself. // A Tab is one ViewItem within it's parent Tabs (which extends ViewController) // A Tab is a ViewController for its child ViewItems - super(tabs, compiler, elementRef, loader, injector); + super(tabs, injector); this.tabs = tabs; this.childNavbar(true); diff --git a/ionic/components/tabs/tabs.js b/ionic/components/tabs/tabs.js index 7e63849bf6..fcce9fc5c2 100644 --- a/ionic/components/tabs/tabs.js +++ b/ionic/components/tabs/tabs.js @@ -46,12 +46,9 @@ export class Tabs extends ViewController { constructor( @Optional() parentViewCtrl: ViewController, @Optional() viewItem: ViewItem, - compiler: Compiler, - elementRef: ElementRef, - loader: DynamicComponentLoader, injector: Injector ) { - super(parentViewCtrl, compiler, elementRef, loader, injector); + super(parentViewCtrl, injector); // Tabs may also be an actual ViewItem which was navigated to // if Tabs is static and not navigated to within a ViewController diff --git a/ionic/components/view/view-controller.js b/ionic/components/view/view-controller.js index 79dc08bed1..e1b377399a 100644 --- a/ionic/components/view/view-controller.js +++ b/ionic/components/view/view-controller.js @@ -15,20 +15,14 @@ export class ViewController { constructor( parentViewCtrl: ViewController, - compiler: Compiler, - elementRef: ElementRef, - loader: DynamicComponentLoader, injector: Injector ) { this.parent = parentViewCtrl; - this.compiler = compiler; - this.elementRef = elementRef; - this.loader = loader; - this.injector = injector; - // TODO: Make this generic? - this.ele = elementRef.nativeElement; + this.compiler = injector.get(Compiler); + this.loader = injector.get(DynamicComponentLoader); + this.injector = injector; this.items = []; this.navCtrl = new NavController(this);