diff --git a/demos/component-docs/index.ts b/demos/component-docs/index.ts index 2a303a7fa5..2af2376cef 100644 --- a/demos/component-docs/index.ts +++ b/demos/component-docs/index.ts @@ -7,12 +7,20 @@ import * as helpers from './helpers'; @App({ templateUrl: 'app.html', + config: { + platforms: { + android: { + activator: 'ripple' + } + } + } }) class DemoApp { rootPage: any; androidAttribute: any; + constructor(app: IonicApp, platform: Platform) { this.app = app; this.platform = platform; diff --git a/ionic/components/app/id.ts b/ionic/components/app/id.ts index d5c5879e72..c89f3f1f5e 100644 --- a/ionic/components/app/id.ts +++ b/ionic/components/app/id.ts @@ -42,14 +42,14 @@ export class IdRef { /** * @private */ - onInit() { + ngOnInit() { this.app.register(this.id, this.component); } /** * @private */ - onDestroy() { + ngOnDestroy() { this.app.unregister(this.id); } } @@ -75,7 +75,7 @@ export class Attr { /** * @private */ - onInit() { + ngOnInit() { this.renderer.setElementAttribute(this.elementRef, this.attr, ''); } } diff --git a/ionic/components/checkbox/checkbox.ts b/ionic/components/checkbox/checkbox.ts index 0bcb708cc3..f640835c47 100644 --- a/ionic/components/checkbox/checkbox.ts +++ b/ionic/components/checkbox/checkbox.ts @@ -65,7 +65,7 @@ export class Checkbox { if (ngControl) ngControl.valueAccessor = this; } - onInit() { + ngOnInit() { this.labelId = 'label-' + this.inputId; } @@ -118,7 +118,7 @@ export class Checkbox { /** * @private */ - onDestroy() { + ngOnDestroy() { this.form.deregister(this); } } diff --git a/ionic/components/content/content.ts b/ionic/components/content/content.ts index f95d9dd1fe..4f3cc7c4bb 100644 --- a/ionic/components/content/content.ts +++ b/ionic/components/content/content.ts @@ -49,8 +49,8 @@ export class Content extends Ion { /** * @private */ - onInit() { - super.onInit(); + ngOnInit() { + super.ngOnInit(); this.scrollElement = this.getNativeElement().children[0]; } diff --git a/ionic/components/icon/icon.ts b/ionic/components/icon/icon.ts index c0a5e9b174..44543c5c3b 100644 --- a/ionic/components/icon/icon.ts +++ b/ionic/components/icon/icon.ts @@ -42,7 +42,7 @@ export class Icon { /** * @private */ - onInit() { + ngOnInit() { let ele = this.elementRef.nativeElement; if (this.mode == 'ios' && this.ios) { diff --git a/ionic/components/ion.ts b/ionic/components/ion.ts index 3ddb77f0ea..fc67620d11 100644 --- a/ionic/components/ion.ts +++ b/ionic/components/ion.ts @@ -14,7 +14,7 @@ export class Ion { this.config = config; } - onInit() { + ngOnInit() { let cls = this.constructor; if (cls.defaultInputs && this.config) { diff --git a/ionic/components/list/list.ts b/ionic/components/list/list.ts index d5e932bac2..0189f0c2bd 100644 --- a/ionic/components/list/list.ts +++ b/ionic/components/list/list.ts @@ -39,8 +39,8 @@ export class List extends Ion { /** * @private */ - onInit() { - super.onInit(); + ngOnInit() { + super.ngOnInit(); if (util.isDefined(this.virtual)) { console.log('Content', this.content); @@ -53,7 +53,7 @@ export class List extends Ion { /** * @private */ - onDestroy() { + ngOnDestroy() { this.ele = null; this.slidingGesture && this.slidingGesture.unlisten(); } @@ -104,7 +104,7 @@ export class List extends Ion { /** * @private */ - afterViewInit() { + ngAfterViewInit() { this._init = true; if (this._enableSliding) { this.enableSlidingItems(true); diff --git a/ionic/components/menu/menu-types.ts b/ionic/components/menu/menu-types.ts index db1e7614a4..6396604c32 100644 --- a/ionic/components/menu/menu-types.ts +++ b/ionic/components/menu/menu-types.ts @@ -67,7 +67,7 @@ export class MenuType { return promise; } - onDestroy() { + ngOnDestroy() { this.open && this.open.dispose(); this.close && this.close.dispose(); this.seek && this.seek.dispose(); diff --git a/ionic/components/menu/menu.ts b/ionic/components/menu/menu.ts index 39fc69c370..db383a9038 100644 --- a/ionic/components/menu/menu.ts +++ b/ionic/components/menu/menu.ts @@ -92,8 +92,8 @@ export class Menu extends Ion { /** * @private */ - onInit() { - super.onInit(); + ngOnInit() { + super.ngOnInit(); let self = this; let content = self.content; @@ -352,11 +352,11 @@ export class Menu extends Ion { /** * @private */ - onDestroy() { + ngOnDestroy() { this.app.unregister(this.id); this._gesture && this._gesture.destroy(); this._targetGesture && this._targetGesture.destroy(); - this._type && this._type.onDestroy(); + this._type && this._type.ngOnDestroy(); this._cntEle = null; } diff --git a/ionic/components/nav/nav-router.ts b/ionic/components/nav/nav-router.ts index fe7d0385bd..a7c17beac1 100644 --- a/ionic/components/nav/nav-router.ts +++ b/ionic/components/nav/nav-router.ts @@ -84,8 +84,8 @@ export class NavRouter extends RouterOutlet { // generate a componentInstruction from the view's PathRecognizer and params let componentInstruction = pathRecognizer.generate(viewCtrl.params.data); - // create an Instruction from the componentInstruction - let instruction = new Instruction(componentInstruction, null); + // create a ResolvedInstruction from the componentInstruction + let instruction = new ResolvedInstruction(componentInstruction, null); 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 { + return Promise.resolve(this.component); + } +} diff --git a/ionic/components/nav/nav.ts b/ionic/components/nav/nav.ts index 110922a74e..94ae9a877d 100644 --- a/ionic/components/nav/nav.ts +++ b/ionic/components/nav/nav.ts @@ -136,8 +136,8 @@ export class Nav extends NavController { /** * @private */ - onInit() { - super.onInit(); + ngOnInit() { + super.ngOnInit(); if (this.root) { if (typeof this.root !== 'function') { diff --git a/ionic/components/navbar/navbar.ts b/ionic/components/navbar/navbar.ts index 833c3fdfae..e717945b28 100644 --- a/ionic/components/navbar/navbar.ts +++ b/ionic/components/navbar/navbar.ts @@ -114,8 +114,8 @@ export class Navbar extends ToolbarBase { /** * @private */ - onInit() { - super.onInit(); + ngOnInit() { + super.ngOnInit(); let hideBackButton = this.hideBackButton; if (typeof hideBackButton === 'string') { this.hideBackButton = (hideBackButton === '' || hideBackButton === 'true'); diff --git a/ionic/components/popup/popup.ts b/ionic/components/popup/popup.ts index a08f0bffb0..351254b1df 100644 --- a/ionic/components/popup/popup.ts +++ b/ionic/components/popup/popup.ts @@ -300,7 +300,7 @@ class PopupCmp { } } - onInit() { + ngOnInit() { setTimeout(() => { // TODO: make more better, no DOM BS this.promptInput = this.elementRef.nativeElement.querySelector('input'); diff --git a/ionic/components/radio/radio.ts b/ionic/components/radio/radio.ts index e15a4b6dbc..e890b6a624 100644 --- a/ionic/components/radio/radio.ts +++ b/ionic/components/radio/radio.ts @@ -72,7 +72,7 @@ export class RadioGroup extends Ion { /** * @private */ - onInit() { + ngOnInit() { let header = this.headerQuery.first; if (header) { if (!header.id) { @@ -210,8 +210,8 @@ export class RadioButton extends Ion { /** * @private */ - onInit() { - super.onInit(); + ngOnInit() { + super.ngOnInit(); this.group.registerRadio(this); this.labelId = 'label-' + this.id; } diff --git a/ionic/components/scroll/pull-to-refresh.ts b/ionic/components/scroll/pull-to-refresh.ts index 774f92481b..2dc200cb01 100644 --- a/ionic/components/scroll/pull-to-refresh.ts +++ b/ionic/components/scroll/pull-to-refresh.ts @@ -84,7 +84,7 @@ export class Refresher { this.pulling = new EventEmitter('pulling'); } - onInit() { + ngOnInit() { this.initEvents(); } diff --git a/ionic/components/scroll/scroll.ts b/ionic/components/scroll/scroll.ts index 30fcdcbae8..a6bcc1ae6d 100644 --- a/ionic/components/scroll/scroll.ts +++ b/ionic/components/scroll/scroll.ts @@ -56,7 +56,7 @@ export class Scroll extends Ion { /** * @private */ - onInit() { + ngOnInit() { this.scrollElement = this.getNativeElement().children[0]; } diff --git a/ionic/components/searchbar/searchbar.ts b/ionic/components/searchbar/searchbar.ts index 8dfeb51f59..29f63d85fc 100644 --- a/ionic/components/searchbar/searchbar.ts +++ b/ionic/components/searchbar/searchbar.ts @@ -75,7 +75,7 @@ export class Searchbar extends Ion { * After the view has initialized check if the searchbar has a value * and then store that value in query */ - afterViewInit() { + ngAfterViewInit() { // If the user passes in a value to the model we should left align this.shouldLeftAlign = this.ngControl.value && this.ngControl.value.trim() != ''; this.query = this.ngControl.value || ''; diff --git a/ionic/components/segment/segment.ts b/ionic/components/segment/segment.ts index bffec63e0c..3b08f4928b 100644 --- a/ionic/components/segment/segment.ts +++ b/ionic/components/segment/segment.ts @@ -196,7 +196,7 @@ export class SegmentButton { /** * @private */ - onInit() { + ngOnInit() { this.segment.register(this); } diff --git a/ionic/components/slides/slides.ts b/ionic/components/slides/slides.ts index 4f663b2721..5ec9763846 100644 --- a/ionic/components/slides/slides.ts +++ b/ionic/components/slides/slides.ts @@ -110,7 +110,7 @@ export class Slides extends Ion { /** * @private */ - onInit() { + ngOnInit() { if(!this.options) { this.options = {}; } diff --git a/ionic/components/slides/test/basic/index.ts b/ionic/components/slides/test/basic/index.ts index f52423b989..cb020b52ff 100644 --- a/ionic/components/slides/test/basic/index.ts +++ b/ionic/components/slides/test/basic/index.ts @@ -34,7 +34,7 @@ class MyApp { }) } - onInit() { + ngOnInit() { setTimeout(() => { this.slider = this.app.getComponent('slider'); console.log('Got slider', this.slider); diff --git a/ionic/components/switch/switch.ts b/ionic/components/switch/switch.ts index 05b1c19373..c6f5c8b9ad 100644 --- a/ionic/components/switch/switch.ts +++ b/ionic/components/switch/switch.ts @@ -160,7 +160,7 @@ export class Switch { /** * @private */ - onInit() { + ngOnInit() { this.labelId = 'label-' + this.inputId; } @@ -238,7 +238,7 @@ export class Switch { /** * @private */ - onDestroy() { + ngOnDestroy() { this.removeMoveListener(); this.switchEle = this.addMoveListener = this.removeMoveListener = null; this.form.deregister(this); diff --git a/ionic/components/tabs/tab.ts b/ionic/components/tabs/tab.ts index fa79f20d95..131f6e7005 100644 --- a/ionic/components/tabs/tab.ts +++ b/ionic/components/tabs/tab.ts @@ -79,7 +79,7 @@ export class Tab extends NavController { /** * @private */ - onInit() { + ngOnInit() { if (this._isInitial) { this.parent.select(this); @@ -173,7 +173,7 @@ export class Tab extends NavController { /** * @private */ - onDestroy() { + ngOnDestroy() { clearTimeout(this._loadTimer); } diff --git a/ionic/components/tabs/tabs.ts b/ionic/components/tabs/tabs.ts index 67aa6f9cc4..6febe49b76 100644 --- a/ionic/components/tabs/tabs.ts +++ b/ionic/components/tabs/tabs.ts @@ -110,8 +110,8 @@ export class Tabs extends Ion { /** * @private */ - onInit() { - super.onInit(); + ngOnInit() { + super.ngOnInit(); this.preloadTabs = (this.preloadTabs !== "false" && this.preloadTabs !== false); if (this._highlight) { @@ -277,7 +277,7 @@ class TabButton extends Ion { this.disHover = (config.get('hoverCSS') === false); } - onInit() { + ngOnInit() { this.tab.btn = this; this.hasTitle = !!this.tab.tabTitle; this.hasIcon = !!this.tab.tabIcon; diff --git a/ionic/components/tabs/test/ghost/index.ts b/ionic/components/tabs/test/ghost/index.ts index 23f2882b63..cb31731976 100644 --- a/ionic/components/tabs/test/ghost/index.ts +++ b/ionic/components/tabs/test/ghost/index.ts @@ -109,7 +109,7 @@ class QuesaritoPage { export class TabsPage { @ViewChildren(Tab) tab : QueryList; - afterViewInit() { + ngAfterViewInit() { console.log('Tab', this.tab); console.log(this.tab.first.setRoot); } @@ -128,6 +128,6 @@ export class TabsPage { this.root2 = Tab2; this.root3 = Tab3; } - onInit() { + ngOnInit() { } } diff --git a/ionic/components/text-input/text-input.ts b/ionic/components/text-input/text-input.ts index f5f6f21a80..a4ae10c534 100644 --- a/ionic/components/text-input/text-input.ts +++ b/ionic/components/text-input/text-input.ts @@ -132,7 +132,7 @@ export class TextInput { /** * @private */ - onInit() { + ngOnInit() { if (this.input && this.label) { // if there is an input and an label // then give the label an ID @@ -443,7 +443,7 @@ export class TextInput { /** * @private */ - onDestroy() { + ngOnDestroy() { this.deregMove(); this.form.deregister(this); } @@ -486,7 +486,7 @@ export class TextInputElement { } } - onInit() { + ngOnInit() { this.wrapper && this.wrapper.hasValue(this.value); } diff --git a/package.json b/package.json index da676d7771..5b4c6ca255 100644 --- a/package.json +++ b/package.json @@ -20,14 +20,15 @@ "tooling" ], "dependencies": { - "@reactivex/rxjs": "5.0.0-alpha.7", - "angular2": "tlancina/angular-package", + "angular2": "2.0.0-alpha.50", "colors": "^1.1.2", + "es6-promise": "^3.0.2", "es6-shim": "0.33.6", "inquirer": "0.11.0", "lodash": "3.10.1", "q": "1.4.1", "reflect-metadata": "0.1.2", + "rxjs": "5.0.0-alpha.14", "shelljs": "0.5.3", "zone.js": "0.5.8" }, diff --git a/scripts/e2e/e2e.template.html b/scripts/e2e/e2e.template.html index 6cedfac34e..badf2c6fff 100644 --- a/scripts/e2e/e2e.template.html +++ b/scripts/e2e/e2e.template.html @@ -86,7 +86,7 @@ "*": "*.js", "ionic/*": "ionic/*", "angular2/*": "angular2/*", - "rx": "rx" + "rxjs/*": "rxjs/*" } }) System.import("index").then(function(m) {}, console.error.bind(console));