mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
Merge branch 'alpha50' into css-refactor
This commit is contained in:
@ -7,12 +7,20 @@ import * as helpers from './helpers';
|
|||||||
|
|
||||||
@App({
|
@App({
|
||||||
templateUrl: 'app.html',
|
templateUrl: 'app.html',
|
||||||
|
config: {
|
||||||
|
platforms: {
|
||||||
|
android: {
|
||||||
|
activator: 'ripple'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
class DemoApp {
|
class DemoApp {
|
||||||
|
|
||||||
rootPage: any;
|
rootPage: any;
|
||||||
androidAttribute: any;
|
androidAttribute: any;
|
||||||
|
|
||||||
|
|
||||||
constructor(app: IonicApp, platform: Platform) {
|
constructor(app: IonicApp, platform: Platform) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
|
@ -42,14 +42,14 @@ export class IdRef {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
this.app.register(this.id, this.component);
|
this.app.register(this.id, this.component);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onDestroy() {
|
ngOnDestroy() {
|
||||||
this.app.unregister(this.id);
|
this.app.unregister(this.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ export class Attr {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
this.renderer.setElementAttribute(this.elementRef, this.attr, '');
|
this.renderer.setElementAttribute(this.elementRef, this.attr, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ export class Checkbox {
|
|||||||
if (ngControl) ngControl.valueAccessor = this;
|
if (ngControl) ngControl.valueAccessor = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
this.labelId = 'label-' + this.inputId;
|
this.labelId = 'label-' + this.inputId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ export class Checkbox {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onDestroy() {
|
ngOnDestroy() {
|
||||||
this.form.deregister(this);
|
this.form.deregister(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,8 @@ export class Content extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
super.onInit();
|
super.ngOnInit();
|
||||||
this.scrollElement = this.getNativeElement().children[0];
|
this.scrollElement = this.getNativeElement().children[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ export class Icon {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
let ele = this.elementRef.nativeElement;
|
let ele = this.elementRef.nativeElement;
|
||||||
|
|
||||||
if (this.mode == 'ios' && this.ios) {
|
if (this.mode == 'ios' && this.ios) {
|
||||||
|
@ -14,7 +14,7 @@ export class Ion {
|
|||||||
this.config = config;
|
this.config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
let cls = this.constructor;
|
let cls = this.constructor;
|
||||||
|
|
||||||
if (cls.defaultInputs && this.config) {
|
if (cls.defaultInputs && this.config) {
|
||||||
|
@ -39,8 +39,8 @@ export class List extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
super.onInit();
|
super.ngOnInit();
|
||||||
|
|
||||||
if (util.isDefined(this.virtual)) {
|
if (util.isDefined(this.virtual)) {
|
||||||
console.log('Content', this.content);
|
console.log('Content', this.content);
|
||||||
@ -53,7 +53,7 @@ export class List extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onDestroy() {
|
ngOnDestroy() {
|
||||||
this.ele = null;
|
this.ele = null;
|
||||||
this.slidingGesture && this.slidingGesture.unlisten();
|
this.slidingGesture && this.slidingGesture.unlisten();
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ export class List extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
afterViewInit() {
|
ngAfterViewInit() {
|
||||||
this._init = true;
|
this._init = true;
|
||||||
if (this._enableSliding) {
|
if (this._enableSliding) {
|
||||||
this.enableSlidingItems(true);
|
this.enableSlidingItems(true);
|
||||||
|
@ -67,7 +67,7 @@ export class MenuType {
|
|||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy() {
|
ngOnDestroy() {
|
||||||
this.open && this.open.dispose();
|
this.open && this.open.dispose();
|
||||||
this.close && this.close.dispose();
|
this.close && this.close.dispose();
|
||||||
this.seek && this.seek.dispose();
|
this.seek && this.seek.dispose();
|
||||||
|
@ -92,8 +92,8 @@ export class Menu extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
super.onInit();
|
super.ngOnInit();
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
let content = self.content;
|
let content = self.content;
|
||||||
@ -352,11 +352,11 @@ export class Menu extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onDestroy() {
|
ngOnDestroy() {
|
||||||
this.app.unregister(this.id);
|
this.app.unregister(this.id);
|
||||||
this._gesture && this._gesture.destroy();
|
this._gesture && this._gesture.destroy();
|
||||||
this._targetGesture && this._targetGesture.destroy();
|
this._targetGesture && this._targetGesture.destroy();
|
||||||
this._type && this._type.onDestroy();
|
this._type && this._type.ngOnDestroy();
|
||||||
this._cntEle = null;
|
this._cntEle = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ export class NavRouter extends RouterOutlet {
|
|||||||
// generate a componentInstruction from the view's PathRecognizer and params
|
// generate a componentInstruction from the view's PathRecognizer and params
|
||||||
let componentInstruction = pathRecognizer.generate(viewCtrl.params.data);
|
let componentInstruction = pathRecognizer.generate(viewCtrl.params.data);
|
||||||
|
|
||||||
// create an Instruction from the componentInstruction
|
// create a ResolvedInstruction from the componentInstruction
|
||||||
let instruction = new Instruction(componentInstruction, null);
|
let instruction = new ResolvedInstruction(componentInstruction, null);
|
||||||
|
|
||||||
this._parentRouter.navigateByInstruction(instruction);
|
this._parentRouter.navigateByInstruction(instruction);
|
||||||
}
|
}
|
||||||
@ -113,3 +113,16 @@ export class NavRouter extends RouterOutlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: hacked from
|
||||||
|
// https://github.com/angular/angular/blob/6ddfff5cd59aac9099aa6da5118c5598eea7ea11/modules/angular2/src/router/instruction.ts#L207
|
||||||
|
class ResolvedInstruction extends Instruction {
|
||||||
|
constructor(public component: ComponentInstruction, public child: Instruction,
|
||||||
|
public auxInstruction: {[key: string]: Instruction}) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
resolveComponent(): Promise<ComponentInstruction> {
|
||||||
|
return Promise.resolve(this.component);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -136,8 +136,8 @@ export class Nav extends NavController {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
super.onInit();
|
super.ngOnInit();
|
||||||
|
|
||||||
if (this.root) {
|
if (this.root) {
|
||||||
if (typeof this.root !== 'function') {
|
if (typeof this.root !== 'function') {
|
||||||
|
@ -114,8 +114,8 @@ export class Navbar extends ToolbarBase {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
super.onInit();
|
super.ngOnInit();
|
||||||
let hideBackButton = this.hideBackButton;
|
let hideBackButton = this.hideBackButton;
|
||||||
if (typeof hideBackButton === 'string') {
|
if (typeof hideBackButton === 'string') {
|
||||||
this.hideBackButton = (hideBackButton === '' || hideBackButton === 'true');
|
this.hideBackButton = (hideBackButton === '' || hideBackButton === 'true');
|
||||||
|
@ -300,7 +300,7 @@ class PopupCmp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// TODO: make more better, no DOM BS
|
// TODO: make more better, no DOM BS
|
||||||
this.promptInput = this.elementRef.nativeElement.querySelector('input');
|
this.promptInput = this.elementRef.nativeElement.querySelector('input');
|
||||||
|
@ -72,7 +72,7 @@ export class RadioGroup extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
let header = this.headerQuery.first;
|
let header = this.headerQuery.first;
|
||||||
if (header) {
|
if (header) {
|
||||||
if (!header.id) {
|
if (!header.id) {
|
||||||
@ -210,8 +210,8 @@ export class RadioButton extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
super.onInit();
|
super.ngOnInit();
|
||||||
this.group.registerRadio(this);
|
this.group.registerRadio(this);
|
||||||
this.labelId = 'label-' + this.id;
|
this.labelId = 'label-' + this.id;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ export class Refresher {
|
|||||||
this.pulling = new EventEmitter('pulling');
|
this.pulling = new EventEmitter('pulling');
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
this.initEvents();
|
this.initEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ export class Scroll extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
this.scrollElement = this.getNativeElement().children[0];
|
this.scrollElement = this.getNativeElement().children[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ export class Searchbar extends Ion {
|
|||||||
* After the view has initialized check if the searchbar has a value
|
* After the view has initialized check if the searchbar has a value
|
||||||
* and then store that value in query
|
* and then store that value in query
|
||||||
*/
|
*/
|
||||||
afterViewInit() {
|
ngAfterViewInit() {
|
||||||
// If the user passes in a value to the model we should left align
|
// If the user passes in a value to the model we should left align
|
||||||
this.shouldLeftAlign = this.ngControl.value && this.ngControl.value.trim() != '';
|
this.shouldLeftAlign = this.ngControl.value && this.ngControl.value.trim() != '';
|
||||||
this.query = this.ngControl.value || '';
|
this.query = this.ngControl.value || '';
|
||||||
|
@ -196,7 +196,7 @@ export class SegmentButton {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
this.segment.register(this);
|
this.segment.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ export class Slides extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
if(!this.options) {
|
if(!this.options) {
|
||||||
this.options = {};
|
this.options = {};
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class MyApp {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.slider = this.app.getComponent('slider');
|
this.slider = this.app.getComponent('slider');
|
||||||
console.log('Got slider', this.slider);
|
console.log('Got slider', this.slider);
|
||||||
|
@ -160,7 +160,7 @@ export class Switch {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
this.labelId = 'label-' + this.inputId;
|
this.labelId = 'label-' + this.inputId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ export class Switch {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onDestroy() {
|
ngOnDestroy() {
|
||||||
this.removeMoveListener();
|
this.removeMoveListener();
|
||||||
this.switchEle = this.addMoveListener = this.removeMoveListener = null;
|
this.switchEle = this.addMoveListener = this.removeMoveListener = null;
|
||||||
this.form.deregister(this);
|
this.form.deregister(this);
|
||||||
|
@ -79,7 +79,7 @@ export class Tab extends NavController {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
if (this._isInitial) {
|
if (this._isInitial) {
|
||||||
this.parent.select(this);
|
this.parent.select(this);
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ export class Tab extends NavController {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onDestroy() {
|
ngOnDestroy() {
|
||||||
clearTimeout(this._loadTimer);
|
clearTimeout(this._loadTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,8 +110,8 @@ export class Tabs extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
super.onInit();
|
super.ngOnInit();
|
||||||
this.preloadTabs = (this.preloadTabs !== "false" && this.preloadTabs !== false);
|
this.preloadTabs = (this.preloadTabs !== "false" && this.preloadTabs !== false);
|
||||||
|
|
||||||
if (this._highlight) {
|
if (this._highlight) {
|
||||||
@ -277,7 +277,7 @@ class TabButton extends Ion {
|
|||||||
this.disHover = (config.get('hoverCSS') === false);
|
this.disHover = (config.get('hoverCSS') === false);
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
this.tab.btn = this;
|
this.tab.btn = this;
|
||||||
this.hasTitle = !!this.tab.tabTitle;
|
this.hasTitle = !!this.tab.tabTitle;
|
||||||
this.hasIcon = !!this.tab.tabIcon;
|
this.hasIcon = !!this.tab.tabIcon;
|
||||||
|
@ -109,7 +109,7 @@ class QuesaritoPage {
|
|||||||
export class TabsPage {
|
export class TabsPage {
|
||||||
@ViewChildren(Tab) tab : QueryList<Tab>;
|
@ViewChildren(Tab) tab : QueryList<Tab>;
|
||||||
|
|
||||||
afterViewInit() {
|
ngAfterViewInit() {
|
||||||
console.log('Tab', this.tab);
|
console.log('Tab', this.tab);
|
||||||
console.log(this.tab.first.setRoot);
|
console.log(this.tab.first.setRoot);
|
||||||
}
|
}
|
||||||
@ -128,6 +128,6 @@ export class TabsPage {
|
|||||||
this.root2 = Tab2;
|
this.root2 = Tab2;
|
||||||
this.root3 = Tab3;
|
this.root3 = Tab3;
|
||||||
}
|
}
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ export class TextInput {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
if (this.input && this.label) {
|
if (this.input && this.label) {
|
||||||
// if there is an input and an label
|
// if there is an input and an label
|
||||||
// then give the label an ID
|
// then give the label an ID
|
||||||
@ -443,7 +443,7 @@ export class TextInput {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onDestroy() {
|
ngOnDestroy() {
|
||||||
this.deregMove();
|
this.deregMove();
|
||||||
this.form.deregister(this);
|
this.form.deregister(this);
|
||||||
}
|
}
|
||||||
@ -486,7 +486,7 @@ export class TextInputElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
ngOnInit() {
|
||||||
this.wrapper && this.wrapper.hasValue(this.value);
|
this.wrapper && this.wrapper.hasValue(this.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,14 +20,15 @@
|
|||||||
"tooling"
|
"tooling"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@reactivex/rxjs": "5.0.0-alpha.7",
|
"angular2": "2.0.0-alpha.50",
|
||||||
"angular2": "tlancina/angular-package",
|
|
||||||
"colors": "^1.1.2",
|
"colors": "^1.1.2",
|
||||||
|
"es6-promise": "^3.0.2",
|
||||||
"es6-shim": "0.33.6",
|
"es6-shim": "0.33.6",
|
||||||
"inquirer": "0.11.0",
|
"inquirer": "0.11.0",
|
||||||
"lodash": "3.10.1",
|
"lodash": "3.10.1",
|
||||||
"q": "1.4.1",
|
"q": "1.4.1",
|
||||||
"reflect-metadata": "0.1.2",
|
"reflect-metadata": "0.1.2",
|
||||||
|
"rxjs": "5.0.0-alpha.14",
|
||||||
"shelljs": "0.5.3",
|
"shelljs": "0.5.3",
|
||||||
"zone.js": "0.5.8"
|
"zone.js": "0.5.8"
|
||||||
},
|
},
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
"*": "*.js",
|
"*": "*.js",
|
||||||
"ionic/*": "ionic/*",
|
"ionic/*": "ionic/*",
|
||||||
"angular2/*": "angular2/*",
|
"angular2/*": "angular2/*",
|
||||||
"rx": "rx"
|
"rxjs/*": "rxjs/*"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
System.import("index").then(function(m) {}, console.error.bind(console));
|
System.import("index").then(function(m) {}, console.error.bind(console));
|
||||||
|
Reference in New Issue
Block a user