mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
Render
This commit is contained in:
@ -1,12 +1,14 @@
|
|||||||
import {Component, View, bootstrap} from 'angular2/angular2'
|
import {Component, View, bootstrap} from 'angular2/angular2'
|
||||||
import {Button} from 'ionic/components/button/button'
|
import {Button} from 'ionic/ionic'
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: '[ion-app]' })
|
@Component({ selector: '[ion-app]' })
|
||||||
@View({
|
@View({
|
||||||
templateUrl: 'main.html',
|
templateUrl: 'main.html',
|
||||||
directives: [Button]
|
directives: [Button]
|
||||||
})
|
})
|
||||||
class IonicApp {}
|
class IonicApp {
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bootstrap(IonicApp)
|
bootstrap(IonicApp)
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
// HACKYFILLS (hack + polyfill)
|
// HACKYFILLS (hack + polyfill)
|
||||||
import {NgElement, ViewContainer} from 'angular2/angular2'
|
import {NgElement, ViewContainer} from 'angular2/angular2'
|
||||||
|
|
||||||
|
//import {DomRenderedElement} from 'ionic/util/render/dom';
|
||||||
|
|
||||||
Object.defineProperties(NgElement.prototype, {
|
Object.defineProperties(NgElement.prototype, {
|
||||||
|
/*
|
||||||
|
renderElement: {
|
||||||
|
get: function() {
|
||||||
|
return new DomRenderedElement(this._view.render.delegate.boundElements[this._boundElementIndex]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
*/
|
||||||
domElement: {
|
domElement: {
|
||||||
get: function() {
|
get: function() {
|
||||||
return this._view.render.delegate.boundElements[this._boundElementIndex];
|
return this._view.render.delegate.boundElements[this._boundElementIndex];
|
||||||
@ -8,6 +18,7 @@ Object.defineProperties(NgElement.prototype, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
Object.defineProperties(ViewContainer.prototype, {
|
Object.defineProperties(ViewContainer.prototype, {
|
||||||
domElement: {
|
domElement: {
|
||||||
get: function() {
|
get: function() {
|
||||||
@ -15,6 +26,7 @@ Object.defineProperties(ViewContainer.prototype, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
export * from 'ionic/components'
|
export * from 'ionic/components'
|
||||||
export * from 'ionic/platform/platform'
|
export * from 'ionic/platform/platform'
|
||||||
|
25
ionic/util/render.js
Normal file
25
ionic/util/render.js
Normal 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
0
ionic/util/render/dom.js
Normal file
14
ionic/util/render/element.js
Normal file
14
ionic/util/render/element.js
Normal 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'); }
|
||||||
|
}
|
||||||
|
*/
|
Reference in New Issue
Block a user