Skip to content

Commit 27cb360

Browse files
committed
Merge branch 'sync-lazy-loading'
2 parents 1bf1a61 + 356ccd9 commit 27cb360

29 files changed

Lines changed: 777 additions & 702 deletions

File tree

scripts/gulp/tasks/test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ function karmaTest(watch: boolean, done: Function) {
8585

8686
let karmaConfig = {
8787
configFile: join(SCRIPTS_ROOT, 'karma/karma.conf.js'),
88+
singleRun: true,
8889
};
8990

9091
if (watch) {
@@ -96,6 +97,9 @@ function karmaTest(watch: boolean, done: Function) {
9697
args: ['--grep', argv.testGrep]
9798
};
9899
}
100+
if (typeof argv.debug !== 'undefined') {
101+
karmaConfig.singleRun = false;
102+
}
99103

100104
new karma.Server(karmaConfig, done).start();
101105
}

scripts/karma/system.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
44

55
// disable console debugs/errors/warns from printing out
66
console.debug = () => {};
7-
console.error = () => {};
7+
// console.error = () => {};
88
console.warn = () => {};
99

1010
__karma__.loaded = function () {};

src/animations/animation.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ export class Animation {
103103
return 0;
104104
}
105105

106+
/**
107+
* Returns if the animation is a root one.
108+
*/
109+
isRoot(): boolean {
110+
return !this.parent;
111+
}
112+
106113
/**
107114
* Set the duration for this animation.
108115
*/

src/components/alert/alert-component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ export class AlertCmp {
256256
}
257257

258258
if (shouldDismiss) {
259-
this.dismiss(button.role).catch(() => {
260-
console.debug('alert can not be dismissed');
261-
});
259+
this.dismiss(button.role);
262260
}
263261
}
264262

src/components/app/test/app.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ describe('App', () => {
167167
expect(plt.exitApp).not.toHaveBeenCalled();
168168
done();
169169
}).catch((err: Error) => {
170+
fail(err);
170171
done(err);
171-
});
172+
});
172173
});
173174

174175
it('should pop the second view in the root nav', () => {

src/components/modal/modal-component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ export class ModalCmp {
9898
const opts: NavOptions = {
9999
minClickBlockDuration: 400
100100
};
101-
return this._viewCtrl.dismiss(null, 'backdrop', opts).catch(() => {
102-
console.debug('Dismiss modal by clicking backdrop was cancelled');
103-
});
101+
return this._viewCtrl.dismiss(null, 'backdrop', opts);
104102
}
105103
}
106104

src/components/modal/test/basic/pages/modal-pass-data/modal-pass-data.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ export class ModalPassData {
4242

4343
submit() {
4444
console.time('modal');
45-
this.viewCtrl.dismiss(this.data).catch(() => {
46-
console.log('submit was cancelled');
47-
});
45+
this.viewCtrl.dismiss(this.data);
4846
}
4947

5048
ionViewCanEnter() {

src/components/nav/nav-push.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ export class NavPush {
7474
@HostListener('click')
7575
onClick(): boolean {
7676
if (this._nav && this.navPush) {
77-
this._nav.push(this.navPush, this.navParams).catch(() => {
78-
console.debug('navPush was rejected');
79-
});
77+
this._nav.push(this.navPush, this.navParams);
8078
return false;
8179
}
8280
return true;

src/components/nav/test/basic/pages/first-page/first-page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</ion-item>
4343
<ion-item>
4444
<ion-label>Toggle Can Leave</ion-label>
45-
<ion-toggle (click)="canLeave = !canLeave"></ion-toggle>
45+
<ion-toggle [(ngModel)]="canLeave"></ion-toggle>
4646
</ion-item>
4747
<button ion-item (click)="viewDismiss()">View Dismiss</button>
4848
<button ion-item (click)="quickPush()">New push during transition</button>

src/components/nav/test/basic/pages/first-page/first-page.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export class FirstPage {
8484
}
8585

8686
ionViewCanLeave() {
87+
this.called.ionViewCanLeave++;
8788
if (this.canLeave) {
8889
return true;
8990
}
@@ -93,8 +94,6 @@ export class FirstPage {
9394
alert.addButton({ text: 'Umm, ok', role: 'cancel', });
9495
alert.present();
9596

96-
this.called.ionViewCanLeave++;
97-
9897
return false;
9998
}
10099

@@ -132,44 +131,37 @@ export class FirstPage {
132131
this.navCtrl.push('full-page', { id: 8675309, myData: [1, 2, 3, 4] }, {
133132
animate: true,
134133
animation: 'md-transition'
135-
}).catch(() => {
136134
});
137135
}
138136

139137
pushAnother() {
140138
this.navCtrl.push('another-page', null, {
141139
animate: true,
142140
animation: 'wp-transition'
143-
}).catch(() => {
144141
});
145142
}
146143

147144
pushTabsPage() {
148-
this.navCtrl.push('tabs').catch(() => {
149-
});
145+
this.navCtrl.push('tabs');
150146
}
151147

152148

153149
quickPush() {
154-
this.navCtrl.push('another-page').catch(() => {
155-
});
150+
this.navCtrl.push('another-page');
156151
setTimeout(() => {
157-
this.navCtrl.push('primary-header-page').catch(() => {
158-
});
152+
this.navCtrl.push('primary-header-page');
159153
}, 150);
160154
}
161155

162156
quickPop() {
163-
this.navCtrl.push('another-page').catch(() => {
164-
});
157+
this.navCtrl.push('another-page');
165158
setTimeout(() => {
166-
this.navCtrl.remove(1, 1).catch(() => {
167-
});
159+
this.navCtrl.remove(1, 1);
168160
}, 250);
169161
}
170162

171163
pop() {
172-
this.navCtrl.pop().catch(() => {});
164+
this.navCtrl.pop();
173165
}
174166

175167
viewDismiss() {

0 commit comments

Comments
 (0)