This commit is contained in:
Max Lynch
2015-05-04 11:29:36 -05:00
parent 631cf190a9
commit 280ee999f0
5 changed files with 56 additions and 3 deletions

View File

@ -1,12 +1,14 @@
import {Component, View, bootstrap} from 'angular2/angular2'
import {Button} from 'ionic/components/button/button'
import {Button} from 'ionic/ionic'
@Component({ selector: '[ion-app]' })
@View({
templateUrl: 'main.html',
directives: [Button]
})
class IonicApp {}
class IonicApp {
constructor() {
}
}
bootstrap(IonicApp)

View File

@ -1,6 +1,16 @@
// HACKYFILLS (hack + polyfill)
import {NgElement, ViewContainer} from 'angular2/angular2'
//import {DomRenderedElement} from 'ionic/util/render/dom';
Object.defineProperties(NgElement.prototype, {
/*
renderElement: {
get: function() {
return new DomRenderedElement(this._view.render.delegate.boundElements[this._boundElementIndex]);
}
},
*/
domElement: {
get: function() {
return this._view.render.delegate.boundElements[this._boundElementIndex];
@ -8,6 +18,7 @@ Object.defineProperties(NgElement.prototype, {
}
});
/*
Object.defineProperties(ViewContainer.prototype, {
domElement: {
get: function() {
@ -15,6 +26,7 @@ Object.defineProperties(ViewContainer.prototype, {
}
}
});
*/
export * from 'ionic/components'
export * from 'ionic/platform/platform'

25
ionic/util/render.js Normal file
View File

@ -0,0 +1,25 @@
/*
import {RenderedElement} from 'ionic/util/render/element';
export class DomRenderedElement extends RenderedElement {
constructor(domElement: Element) {
super(domElement)
}
addClass(className) {
this.element.classList.add(classList);
}
removeClass(className) {
this.element.classList.remove(classList);
}
addClasses(classes) {
for(let c of classes) {
this.element.classList.add(c);
}
}
removeClasses(classes) {
for(let c of classes) {
this.element.classList.remove(c);
}
}
}
*/

0
ionic/util/render/dom.js Normal file
View File

View File

@ -0,0 +1,14 @@
/*
class RenderedElement {
constructor(element) {
this.element = element;
}
_notImplemented(fnName) {
console.error("RenderedElement." + fnName + "addClass is not implemented. Use a concrete class like DomRenderedElement instead.");
}
addClass(className) { this._notImplemented('addClass'); }
removeClass(className) { this._notImplemented('removeClass'); }
addClasses(className) { this._notImplemented('addClasses'); }
removeClasses(className) { this._notImplemented('removeClasses'); }
}
*/