mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(): updates for angular 2.0.0-beta.16
This commit is contained in:
@@ -92,7 +92,7 @@ describe('IonicApp', () => {
|
||||
var _cd: any;
|
||||
|
||||
function mockNav(): Nav {
|
||||
return new Nav(null, null, null, config, null, null, null, null, null, null);
|
||||
return new Nav(null, null, null, config, null, null, null, null, null);
|
||||
}
|
||||
|
||||
function mockTabs(): Tabs {
|
||||
@@ -100,7 +100,7 @@ describe('IonicApp', () => {
|
||||
}
|
||||
|
||||
function mockTab(parentTabs: Tabs): Tab {
|
||||
return new Tab(parentTabs, app, config, null, null, null, null, null, null, _cd);
|
||||
return new Tab(parentTabs, app, config, null, null, null, null, null, _cd);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -1319,7 +1319,7 @@ export function run() {
|
||||
function mockNav() {
|
||||
let elementRef = getElementRef();
|
||||
|
||||
let nav = new NavController(null, null, config, null, elementRef, null, null, null, null, null);
|
||||
let nav = new NavController(null, null, config, null, elementRef, null, null, null);
|
||||
|
||||
nav._keyboard = {
|
||||
isOpen: function() {
|
||||
@@ -1340,7 +1340,7 @@ export function run() {
|
||||
setElementStyle: function(){}
|
||||
};
|
||||
|
||||
nav._portal = new NavController(null, null, config, null, elementRef, null, null, null, null, null);
|
||||
nav._portal = new NavController(null, null, config, null, elementRef, null, null, null);
|
||||
|
||||
return nav;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
import {RouteConfig, Location} from 'angular2/router';
|
||||
import {RouteConfig,} from 'angular2/router';
|
||||
import {Location} from 'angular2/platform/common';
|
||||
|
||||
import {App, Page, NavParams, ViewController} from 'ionic-angular';
|
||||
|
||||
|
||||
@Page({templateUrl: 'view1.html'})
|
||||
class View1Cmp {
|
||||
constructor(location: Location, viewCtrl: ViewController) {
|
||||
path: string;
|
||||
windowHash: string;
|
||||
|
||||
constructor(location: Location, private viewCtrl: ViewController) {
|
||||
this.path = location.path();
|
||||
this.viewCtrl = viewCtrl;
|
||||
console.log(`View1Cmp, path: ${this.path}`);
|
||||
}
|
||||
|
||||
onPageDidEnter() {
|
||||
this.windowHash = window.location.hash;
|
||||
}
|
||||
@@ -18,11 +22,14 @@ class View1Cmp {
|
||||
|
||||
@Page({templateUrl: 'view2.html'})
|
||||
class View2Cmp {
|
||||
constructor(location: Location, viewCtrl: ViewController) {
|
||||
path: string;
|
||||
windowHash: string;
|
||||
|
||||
constructor(location: Location, private viewCtrl: ViewController) {
|
||||
this.path = location.path();
|
||||
this.viewCtrl = viewCtrl;
|
||||
console.log(`View2Cmp, path: ${this.path}`);
|
||||
}
|
||||
|
||||
onPageDidEnter() {
|
||||
this.windowHash = window.location.hash;
|
||||
}
|
||||
@@ -31,12 +38,16 @@ class View2Cmp {
|
||||
|
||||
@Page({templateUrl: 'view3.html'})
|
||||
class View3Cmp {
|
||||
constructor(params: NavParams, location: Location, viewCtrl: ViewController) {
|
||||
id: string;
|
||||
path: string;
|
||||
windowHash: string;
|
||||
|
||||
constructor(params: NavParams, location: Location, private viewCtrl: ViewController) {
|
||||
this.id = params.get('id');
|
||||
this.path = location.path();
|
||||
this.viewCtrl = viewCtrl;
|
||||
console.log(`View3Cmp, path: ${this.path}, param id: ${this.id}`);
|
||||
}
|
||||
|
||||
onPageDidEnter() {
|
||||
this.windowHash = window.location.hash;
|
||||
}
|
||||
@@ -50,7 +61,5 @@ class View3Cmp {
|
||||
{ path: '/3/:id', component: View3Cmp, as: 'Third' }
|
||||
])
|
||||
class InboxApp {
|
||||
constructor(location: Location) {
|
||||
this.location = location;
|
||||
}
|
||||
constructor(private location: Location) {}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {ViewChild} from 'angular2/core';
|
||||
import {RouteConfig, Location} from 'angular2/router';
|
||||
import {RouteConfig} from 'angular2/router';
|
||||
import {Location} from 'angular2/platform/common';
|
||||
|
||||
import {App, Page, NavController, NavParams, Modal, ViewController, Tabs} from 'ionic-angular';
|
||||
|
||||
@@ -64,14 +65,12 @@ class ChatPage {
|
||||
templateUrl: './tabs.html'
|
||||
})
|
||||
class TabsPage {
|
||||
tab1Root = Tab1Page1;
|
||||
tab2Root = Tab2Page1;
|
||||
tab3Root = Tab3Page1;
|
||||
@ViewChild(Tabs) tabs: Tabs;
|
||||
|
||||
constructor(private nav: NavController, private params: NavParams) {
|
||||
this.tab1Root = Tab1Page1;
|
||||
this.tab1Params = params;
|
||||
this.tab2Root = Tab2Page1;
|
||||
this.tab3Root = Tab3Page1;
|
||||
}
|
||||
constructor(private nav: NavController, private params: NavParams) {}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.tabs.change.subscribe(tab => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
<ion-tabs preloadTabs="false" (change)="onTabChange()">
|
||||
<ion-tab tabTitle="Recents" tabIcon="call" [root]="tab1Root" [rootParams]="tab1Params"></ion-tab>
|
||||
<ion-tab tabTitle="Recents" tabIcon="call" [root]="tab1Root" [rootParams]="params"></ion-tab>
|
||||
<ion-tab tabTitle="Favorites" tabIcon="star" [root]="tab2Root"></ion-tab>
|
||||
<ion-tab tabTitle="Settings" tabIcon="settings" [root]="tab3Root"></ion-tab>
|
||||
<ion-tab tabTitle="Chat" tabIcon="chatbubbles" (select)="chat()"></ion-tab>
|
||||
|
||||
Reference in New Issue
Block a user