diff --git a/README.md b/README.md index 9286b0c1ab..1445902aea 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,8 @@ to create more examples. * The biggest thing to remember: your app has to import its dependencies with the `app/` prefix. For example `import {Apple} from 'apple';` would import apple.js in your example app. + + +#### Update Angular + + ./scripts/build/update-angular.sh diff --git a/ionic/components/content/content.js b/ionic/components/content/content.js index 40575c150d..09d4f1efff 100644 --- a/ionic/components/content/content.js +++ b/ionic/components/content/content.js @@ -17,7 +17,6 @@ export class Content { constructor( @NgElement() element:NgElement ) { - console.log('constructing content', element.domElement); this.domElement = element.domElement; this.domElement.classList.add('content'); } diff --git a/ionic/components/toolbar/toolbar.js b/ionic/components/toolbar/toolbar.js index c99d37359a..a597d0a3d6 100644 --- a/ionic/components/toolbar/toolbar.js +++ b/ionic/components/toolbar/toolbar.js @@ -2,9 +2,10 @@ import { NgElement, Component, Decorator, - View as NgView, Viewport, - //ViewContainerRef, + View as NgView, + ViewContainer, + //ProtoViewRef, onDestroy, Ancestor, ElementRef, @@ -16,6 +17,12 @@ import {NavController} from 'ionic/components/nav/nav-item'; import {raf} from 'ionic/util/dom'; import {platform} from 'ionic/platform/platform'; + +// FYI for later: +// https://github.com/angular/angular/commit/3aac2fefd7f93c74abfa5ee58aa0ea8d4840b519 + + + @Viewport({ selector: '[ion-toolbar]', properties: { @@ -23,34 +30,38 @@ import {platform} from 'ionic/platform/platform'; } }) export class Toolbar { + constructor( - //viewContainer: ViewContainerRef, + viewContainer: ViewContainer, + //protoViewRef: ProtoViewRef, elementRef: ElementRef, @Ancestor() navCtrl: NavController, element: NgElement // context: Object TODO wait for angular to implement this ) { - //this.viewContainer = viewContainer; + this.viewContainer = viewContainer; this.elementRef = elementRef; this.navCtrl = navCtrl; + console.log('Toolbar!'); + // TODO use config to add these classes - // this.viewContainer.domElement.classList.add('toolbar'); - // this.viewContainer.domElement.classList.add(`toolbar-${platform.getName()}`); + this.viewContainer.domElement.classList.add('toolbar'); + this.viewContainer.domElement.classList.add(`toolbar-${platform.getName()}`); // TODO Make a better way than this - // if (/header/i.test(this.viewContainer.domElement.tagName)) { - // this.placement = 'top'; - // } else { - // this.placement = 'bottom'; - // } + if (/header/i.test(this.viewContainer.domElement.tagName)) { + this.placement = 'top'; + } else { + this.placement = 'bottom'; + } } set placement(pos) { - //this.viewContainer.domElement.classList.add(`toolbar-${pos}`); + this.viewContainer.domElement.classList.add(`toolbar-${pos}`); this._placement = pos; this.navCtrl.addToolbar(this._placement, this); - //this.viewContainer.domElement.setAttribute('placement', pos); + this.viewContainer.domElement.setAttribute('placement', pos); } onDestroy() { diff --git a/ionic/ionic.js b/ionic/ionic.js index d09111f369..d55a80e28b 100644 --- a/ionic/ionic.js +++ b/ionic/ionic.js @@ -1,5 +1,5 @@ // HACKYFILLS (hack + polyfill) -import {NgElement, ViewContainerRef} from 'angular2/angular2' +import {NgElement, ViewContainer} from 'angular2/angular2' Object.defineProperties(NgElement.prototype, { domElement: { get: function() { @@ -8,14 +8,14 @@ Object.defineProperties(NgElement.prototype, { } }); -Object.defineProperties(ViewContainerRef.prototype, { +Object.defineProperties(ViewContainer.prototype, { domElement: { get: function() { - return this._defaultProtoView.render.delegate.element; + return this.defaultProtoView.render.delegate.element; } } }); -console.log(ViewContainerRef) + export * from 'ionic/components' export * from 'ionic/platform/platform' export * from 'ionic/routing/router' diff --git a/scripts/build/update-angular.sh b/scripts/build/update-angular.sh index 1f66fc2f3d..82f0c796be 100755 --- a/scripts/build/update-angular.sh +++ b/scripts/build/update-angular.sh @@ -14,7 +14,8 @@ echo "Running npm install in angular2..." npm install echo "Running gulp to build source..." -gulp build/transpile.js.dev.es6 +gulp clean +gulp build.js echo "--" echo "-- DONE, gulp will work now --"