From 4ecb9681aabfd28cf12298cd11a294f99c897671 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Fri, 11 Dec 2015 08:38:27 -0600 Subject: [PATCH] fix(transition): default to ios-transition if animation not found --- ionic/animations/animation.ts | 7 +++---- ionic/components/modal/test/basic/index.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ionic/animations/animation.ts b/ionic/animations/animation.ts index 1006147d4a..adc0852117 100644 --- a/ionic/animations/animation.ts +++ b/ionic/animations/animation.ts @@ -539,11 +539,10 @@ export class Animation { } static createTransition(enteringView, leavingView, opts = {}) { - const name = opts.animation || 'ios-transition'; - - let TransitionClass = AnimationRegistry[name]; + let TransitionClass = AnimationRegistry[opts.animation]; if (!TransitionClass) { - TransitionClass = Animation; + // didn't find a transition animation, default to ios-transition + TransitionClass = AnimationRegistry['ios-transition']; } return new TransitionClass(enteringView, leavingView, opts); diff --git a/ionic/components/modal/test/basic/index.ts b/ionic/components/modal/test/basic/index.ts index 820832e1eb..0fdab060a2 100644 --- a/ionic/components/modal/test/basic/index.ts +++ b/ionic/components/modal/test/basic/index.ts @@ -174,7 +174,7 @@ class ModalFirstPage { push() { let page = ModalSecondPage; let params = { id: 8675309, myData: [1,2,3,4] }; - let opts = { animation: 'ios' }; + let opts = { animation: 'ios-transition' }; this.nav.push(page, params, opts); }