mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
step forward
This commit is contained in:
@ -8,3 +8,8 @@
|
|||||||
to create more examples.
|
to create more examples.
|
||||||
* The biggest thing to remember: your app has to import its dependencies with the `app/` prefix.
|
* 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.
|
For example `import {Apple} from 'apple';` would import apple.js in your example app.
|
||||||
|
|
||||||
|
|
||||||
|
#### Update Angular
|
||||||
|
|
||||||
|
./scripts/build/update-angular.sh
|
||||||
|
@ -17,7 +17,6 @@ export class Content {
|
|||||||
constructor(
|
constructor(
|
||||||
@NgElement() element:NgElement
|
@NgElement() element:NgElement
|
||||||
) {
|
) {
|
||||||
console.log('constructing content', element.domElement);
|
|
||||||
this.domElement = element.domElement;
|
this.domElement = element.domElement;
|
||||||
this.domElement.classList.add('content');
|
this.domElement.classList.add('content');
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,10 @@ import {
|
|||||||
NgElement,
|
NgElement,
|
||||||
Component,
|
Component,
|
||||||
Decorator,
|
Decorator,
|
||||||
View as NgView,
|
|
||||||
Viewport,
|
Viewport,
|
||||||
//ViewContainerRef,
|
View as NgView,
|
||||||
|
ViewContainer,
|
||||||
|
//ProtoViewRef,
|
||||||
onDestroy,
|
onDestroy,
|
||||||
Ancestor,
|
Ancestor,
|
||||||
ElementRef,
|
ElementRef,
|
||||||
@ -16,6 +17,12 @@ import {NavController} from 'ionic/components/nav/nav-item';
|
|||||||
import {raf} from 'ionic/util/dom';
|
import {raf} from 'ionic/util/dom';
|
||||||
import {platform} from 'ionic/platform/platform';
|
import {platform} from 'ionic/platform/platform';
|
||||||
|
|
||||||
|
|
||||||
|
// FYI for later:
|
||||||
|
// https://github.com/angular/angular/commit/3aac2fefd7f93c74abfa5ee58aa0ea8d4840b519
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Viewport({
|
@Viewport({
|
||||||
selector: '[ion-toolbar]',
|
selector: '[ion-toolbar]',
|
||||||
properties: {
|
properties: {
|
||||||
@ -23,34 +30,38 @@ import {platform} from 'ionic/platform/platform';
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
export class Toolbar {
|
export class Toolbar {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
//viewContainer: ViewContainerRef,
|
viewContainer: ViewContainer,
|
||||||
|
//protoViewRef: ProtoViewRef,
|
||||||
elementRef: ElementRef,
|
elementRef: ElementRef,
|
||||||
@Ancestor() navCtrl: NavController,
|
@Ancestor() navCtrl: NavController,
|
||||||
element: NgElement
|
element: NgElement
|
||||||
// context: Object TODO wait for angular to implement this
|
// context: Object TODO wait for angular to implement this
|
||||||
) {
|
) {
|
||||||
//this.viewContainer = viewContainer;
|
this.viewContainer = viewContainer;
|
||||||
this.elementRef = elementRef;
|
this.elementRef = elementRef;
|
||||||
this.navCtrl = navCtrl;
|
this.navCtrl = navCtrl;
|
||||||
|
|
||||||
|
console.log('Toolbar!');
|
||||||
|
|
||||||
// TODO use config to add these classes
|
// TODO use config to add these classes
|
||||||
// this.viewContainer.domElement.classList.add('toolbar');
|
this.viewContainer.domElement.classList.add('toolbar');
|
||||||
// this.viewContainer.domElement.classList.add(`toolbar-${platform.getName()}`);
|
this.viewContainer.domElement.classList.add(`toolbar-${platform.getName()}`);
|
||||||
|
|
||||||
// TODO Make a better way than this
|
// TODO Make a better way than this
|
||||||
// if (/header/i.test(this.viewContainer.domElement.tagName)) {
|
if (/header/i.test(this.viewContainer.domElement.tagName)) {
|
||||||
// this.placement = 'top';
|
this.placement = 'top';
|
||||||
// } else {
|
} else {
|
||||||
// this.placement = 'bottom';
|
this.placement = 'bottom';
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set placement(pos) {
|
set placement(pos) {
|
||||||
//this.viewContainer.domElement.classList.add(`toolbar-${pos}`);
|
this.viewContainer.domElement.classList.add(`toolbar-${pos}`);
|
||||||
this._placement = pos;
|
this._placement = pos;
|
||||||
this.navCtrl.addToolbar(this._placement, this);
|
this.navCtrl.addToolbar(this._placement, this);
|
||||||
//this.viewContainer.domElement.setAttribute('placement', pos);
|
this.viewContainer.domElement.setAttribute('placement', pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// HACKYFILLS (hack + polyfill)
|
// HACKYFILLS (hack + polyfill)
|
||||||
import {NgElement, ViewContainerRef} from 'angular2/angular2'
|
import {NgElement, ViewContainer} from 'angular2/angular2'
|
||||||
Object.defineProperties(NgElement.prototype, {
|
Object.defineProperties(NgElement.prototype, {
|
||||||
domElement: {
|
domElement: {
|
||||||
get: function() {
|
get: function() {
|
||||||
@ -8,14 +8,14 @@ Object.defineProperties(NgElement.prototype, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.defineProperties(ViewContainerRef.prototype, {
|
Object.defineProperties(ViewContainer.prototype, {
|
||||||
domElement: {
|
domElement: {
|
||||||
get: function() {
|
get: function() {
|
||||||
return this._defaultProtoView.render.delegate.element;
|
return this.defaultProtoView.render.delegate.element;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(ViewContainerRef)
|
|
||||||
export * from 'ionic/components'
|
export * from 'ionic/components'
|
||||||
export * from 'ionic/platform/platform'
|
export * from 'ionic/platform/platform'
|
||||||
export * from 'ionic/routing/router'
|
export * from 'ionic/routing/router'
|
||||||
|
@ -14,7 +14,8 @@ echo "Running npm install in angular2..."
|
|||||||
npm install
|
npm install
|
||||||
|
|
||||||
echo "Running gulp to build source..."
|
echo "Running gulp to build source..."
|
||||||
gulp build/transpile.js.dev.es6
|
gulp clean
|
||||||
|
gulp build.js
|
||||||
|
|
||||||
echo "--"
|
echo "--"
|
||||||
echo "-- DONE, gulp will work now --"
|
echo "-- DONE, gulp will work now --"
|
||||||
|
Reference in New Issue
Block a user