You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using ionic beta 1. I was looking for methods to dynamically set the animation class on ionNavView directive (animation attribute is quite static), so I dived into ionic-angular.js and found that ionic tries to read navViewScope.$nextAnimation first, and if it isn't there, then it tries to read the animation attribute. So, I decided to try it, only to find that it was automatically being set to undefined soon after the page loads. I traced the error to this code in ionic-angular.js , which starts on line 1870 :
getRenderer: function(navViewElement, navViewAttrs, navViewScope) {
var service = this;
var registerData;
var doAnimation;
// climb up the DOM and see which animation classname to use, if any
var animationClass = angular.isDefined(navViewScope.$nextAnimation) ?
navViewScope.$nextAnimation :
getParentAnimationClass(navViewElement[0]);
navViewScope.$nextAnimation = undefined;
function getParentAnimationClass(el) {
var className = '';
while(!className && el) {
className = el.getAttribute('animation');
el = el.parentElement;
}
return className;
}
function setAnimationClass() {
// add the animation CSS class we're gonna use to transition between views
if (animationClass) {
navViewElement[0].classList.add(animationClass);
}
if(registerData.navDirection === 'back') {
// animate like we're moving backward
navViewElement[0].classList.add('reverse');
} else {
// defaults to animate forward
// make sure the reverse class isn't already added
navViewElement[0].classList.remove('reverse');
}
}
It's the line 1880 (navViewScope.$nextAnimation = undefined;) that bothers me. It sets the $nextAnimation variable in the scope to undefined, which affects the future calls to getRenderer function.
I don't see what purpose that line serves, and I think it should be removed. I tried to run my application with that line commented out and it worked as expected.
The text was updated successfully, but these errors were encountered:
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
I'm using ionic beta 1. I was looking for methods to dynamically set the animation class on ionNavView directive (animation attribute is quite static), so I dived into ionic-angular.js and found that ionic tries to read
navViewScope.$nextAnimation
first, and if it isn't there, then it tries to read theanimation
attribute. So, I decided to try it, only to find that it was automatically being set toundefined
soon after the page loads. I traced the error to this code in ionic-angular.js , which starts on line 1870 :It's the line 1880 (
navViewScope.$nextAnimation = undefined;
) that bothers me. It sets the$nextAnimation
variable in the scope toundefined
, which affects the future calls togetRenderer
function.I don't see what purpose that line serves, and I think it should be removed. I tried to run my application with that line commented out and it worked as expected.
The text was updated successfully, but these errors were encountered: