-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Cannot read property 'direction' of undefined after upgrade to 0.13.0 #3619
Comments
Can you add a plunkr so we can reproduce and debug this ourselves? |
We are preparing for a demo and so I may not be able to do this for a few days, but I'll try to get you something. |
Smells like a ngAnimate issue. ngAnimate should be added separately to your project. |
Sooo... what's a solution here? |
@iorlas There is no solution since @ScottFred didn't post a plunkr for us to reproduce the problem yet. When he does, we're able to check what's wrong and draw a conclusion. But it seems like, like I've said in my last comment, you should just include |
@rvanbaalen sadness ;_; |
Here a plunker with error: Version 1.3.16 angular Version 1.4.0 angular http://plnkr.co/edit/Xq5UfcGdUZX1HITYE3UJ?p=preview Both with angular-ui 0.13.0 |
See console log erros The error is throw when there is more than one element with a class 'item' and this change. The error doesnt happend when element has no class 'item'. The thing is this animation '.item' from carousel code .animation('.item', [
'$animate',
function ($animate) {
return {
beforeAddClass: function (element, className, done) {
// Due to transclusion, noTransition property is on parent's scope
if (className == 'active' && element.parent() &&
!element.parent().scope().noTransition) {
var stopped = false;
var direction = element.isolateScope().direction;
var directionClass = direction == 'next' ? 'left' : 'right';
element.addClass(direction);
$animate.addClass(element, directionClass).then(function () {
if (!stopped) {
element.removeClass(directionClass + ' ' + direction);
}
done();
});
return function () {
stopped = true;
};
}
done();
}, The other thing is scope.$watch('active', function(active) {
if (active) {
carouselCtrl.select(scope);
}
}); in the carousel directive. the active class i add, trigger the watcher. So combination .item with .active with ng-animate with too generic carousel'selector .item, is the error. PD. I really sorry with my english level. |
Hi, Any advice or how to deal with this issue? is another thing the error? regards, |
Hello, is there any news about this error ? Thanks. |
Hi, I ran into the same bug. It looks like the issue is that the ".item" animation tries to access an isolate scope which is defined through the carousel directive (line 342). My code (and the plunkr above) doesn’t use the carousel directive because I just want to use the bootstrap CSS. So in short, it happens when you try to use .item elements without the carousel directive. Ideally the animation would be changed so it’d still work if the “.item” has no carousel parent. In the meantime, you could:
|
The carousel should work properly in 1.3 and 1.4 in Closing this as old. |
After upgrading to 0.13.0, we are getting the following errors when we navigate across a top menu system we implemented; this used to work in 0.12.x
------- ui-bootstrap-tpls.js:608 - 616 ------
The text was updated successfully, but these errors were encountered: