mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(navCtrl): print out error msg for invalid component
This commit is contained in:
@@ -232,7 +232,9 @@ export class NavController extends Ion {
|
||||
*/
|
||||
push(componentType, params = {}, opts = {}, callback) {
|
||||
if (!componentType) {
|
||||
return Promise.reject('invalid componentType to push');
|
||||
let errMsg = 'invalid componentType to push';
|
||||
console.error(errMsg)
|
||||
return Promise.reject(errMsg);
|
||||
}
|
||||
|
||||
if (typeof componentType !== 'function') {
|
||||
|
||||
@@ -43,7 +43,9 @@ export class OverlayController {
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
})
|
||||
}, rejectReason => {
|
||||
console.error(rejectReason);
|
||||
});
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user