diff --git a/ionic/components/app/app.ts b/ionic/components/app/app.ts index 51ae919c66..78097455db 100644 --- a/ionic/components/app/app.ts +++ b/ionic/components/app/app.ts @@ -95,7 +95,9 @@ export class IonicApp { let loader = this.injector.get(DynamicComponentLoader); let rootComponentRef = this.ref()._hostComponent; - return loader.loadNextToLocation(component, rootComponentRef.location, this.bindings) + let bindings = this.injector._proto._strategy.bindings; + + return loader.loadNextToLocation(component, rootComponentRef.location) .catch(err => { console.error('appendComponent:', err); }); @@ -149,18 +151,6 @@ function initApp(window, document, config) { return app; } -@Component({ - selector: 'test-comp' -}) -@View({ - template: 'test-comp text' -}) -class TestComp { - constructor(config: IonicConfig) { - console.log('TestComp constructor') - } -} - export function ionicBootstrap(component, config, router) { return new Promise(resolve => { try { diff --git a/ionic/components/icon/icon.ts b/ionic/components/icon/icon.ts index a56f3e33f4..f47e6437f7 100644 --- a/ionic/components/icon/icon.ts +++ b/ionic/components/icon/icon.ts @@ -1,4 +1,4 @@ -import {Directive, View, CSSClass, ElementRef, Optional, Ancestor, Attribute} from 'angular2/angular2'; +import {Directive, View, CSSClass, ElementRef, Optional, Ancestor, Attribute, Renderer} from 'angular2/angular2'; import {IonicConfig} from '../../config/config'; import {IonicComponent} from '../../config/annotations'; @@ -65,12 +65,13 @@ Custom Font Icon }) export class IconDirective { constructor( - elementRef: ElementRef, + private _elementRef: ElementRef, @Optional() @Ancestor() AncestorButton: Button, @Attribute('forward') forward: string, - config: IonicConfig + config: IonicConfig, + private _renderer: Renderer ) { - let ele = this.ele = elementRef.nativeElement; + let ele = this.ele = _elementRef.nativeElement; this.iconLeft = this.iconRight = this.iconOnly = false; this.ariaHidden = true; @@ -108,7 +109,7 @@ export class IconDirective { if (!this.name) return; // add the css class to show the icon font - this.ele.classList.add(this.name); + this._renderer.setElementClass(this._elementRef, this.name, true); // hide the icon when it's within a button // and the button isn't an icon only button diff --git a/ionic/components/view/view-controller.ts b/ionic/components/view/view-controller.ts index 1be76e5287..539e4317a7 100644 --- a/ionic/components/view/view-controller.ts +++ b/ionic/components/view/view-controller.ts @@ -46,11 +46,6 @@ export class ViewController extends Ion { this._ids = -1; // build a new injector for child ViewItems to use - this.injector = injector.resolveAndCreateChild([ - bind(ViewController).toValue(this), - bind(NavController).toValue(new NavController(this)) - ]); - this.bindings = Injector.resolve([ bind(ViewController).toValue(this), bind(NavController).toValue(new NavController(this))