Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI-Router - use $state.go or $location.path?

What do you think is better using : $state.go or $location.path?

My animation doesn't work with state.go but do with $location.path.

Does any one know why?

Thanks!

like image 453
einav Avatar asked Oct 21 '14 10:10

einav


1 Answers

You can use the module ngAnimate instead of ngClass directive to animate view/state changes. The module adds specific css classes on elements which changes. To see animations in action, you must only define the appropriate CSS classes

Here you can find an small introduction how this with the ui-router module works.

UPDATE

Sorry for the delay... There is no reason why this shouldn't work. The UI-router plugin internally call $state.go() when $location.path changed.

See the forked plunker how $state.go() works in combination with ngAnimate module.

like image 114
Sven Schürmann Avatar answered Sep 28 '22 06:09

Sven Schürmann