working modals

This commit is contained in:
Adam Bradley
2015-10-05 11:05:51 -05:00
parent 7a4f2ea3b1
commit cd319e1cf2
8 changed files with 49 additions and 52 deletions

View File

@@ -1,6 +1,7 @@
import {Component, ComponentRef, Compiler, ElementRef, Injector, bind, NgZone, DynamicComponentLoader, DirectiveBinding, AppViewManager} from 'angular2/angular2';
import {ComponentRef, Compiler, ElementRef, Injector, bind, NgZone, DynamicComponentLoader, AppViewManager} from 'angular2/angular2';
import {Ion} from '../ion';
import {makeComponent} from '../../config/decorators';
import {IonicConfig} from '../../config/config';
import {IonicApp} from '../app/app';
import {ViewController} from './view-controller';
@@ -483,20 +484,15 @@ export class NavController extends Ion {
*/
compileView(componentType) {
// create a new ion-view annotation
let annotation = new Component({
let viewComponentType = makeComponent(componentType, {
selector: 'ion-view',
host: {
'[class.pane-view]': '_paneView'
}
});
let ionViewComponentType = DirectiveBinding.createFromType(componentType, annotation);
// create a unique token that works as a cache key
ionViewComponentType.token = 'ionView' + componentType.name;
// compile the Component
return this.compiler.compileInHost(ionViewComponentType);
return this.compiler.compileInHost(viewComponentType);
}
/**
@@ -504,7 +500,7 @@ export class NavController extends Ion {
* TODO
*/
createViewComponetRef(hostProtoViewRef, contentContainerRef, viewCtrlBindings) {
let bindings = this.bindings.concat(Injector.resolve(viewCtrlBindings));
let bindings = this.bindings.concat(viewCtrlBindings);
// the same guts as DynamicComponentLoader.loadNextToLocation
var hostViewRef =

View File

@@ -309,22 +309,22 @@ export class Nav extends NavController {
let tabs = false;
//let key = '_';
componentProtoViewRef._protoView.elementBinders.forEach(rootElementBinder => {
if (!rootElementBinder.componentDirective || !rootElementBinder.nestedProtoView) return;
// componentProtoViewRef._protoView.elementBinders.forEach(rootElementBinder => {
// if (!rootElementBinder.componentDirective || !rootElementBinder.nestedProtoView) return;
rootElementBinder.nestedProtoView.elementBinders.forEach(nestedElementBinder => {
if ( isComponent(nestedElementBinder, 'Tabs') ) {
tabs = true;
}
if (!nestedElementBinder.componentDirective && nestedElementBinder.nestedProtoView) {
nestedElementBinder.nestedProtoView.elementBinders.forEach(templatedElementBinder => {
if ( isComponent(templatedElementBinder, 'Navbar') ) {
navbar = true;
}
});
}
});
});
// rootElementBinder.nestedProtoView.elementBinders.forEach(nestedElementBinder => {
// if ( isComponent(nestedElementBinder, 'Tabs') ) {
// tabs = true;
// }
// if (!nestedElementBinder.componentDirective && nestedElementBinder.nestedProtoView) {
// nestedElementBinder.nestedProtoView.elementBinders.forEach(templatedElementBinder => {
// if ( isComponent(templatedElementBinder, 'Navbar') ) {
// navbar = true;
// }
// });
// }
// });
// });
return {
navbar,