Closed oliodj closed 9 years ago
could line 146 be optional?
var duration = $state.previous.name === '' ? 0 : from.duration, // don't trigger transition on boot
What are you actually trying to do? Animate a state in at the beginning?
If so then the simplest thing to do is probably just trigger the state by forcing the transition with $state.go('stateName', {reload: true})
or switching to a blank intermediary state and then immediately switching back.
exactly. have been figuring out workarounds to trigger a transition on boot on every site I've used this on, feels a bit hacky though. would making transition on boot configurable cause any issues? if not I don't mind making a pull request...
Well it would be a pretty major change - the reason its setup this way is to mirror the behaviour of ui-router
which doesn't cause a transition on initial load, I've taken this to be the expected behaviour now.
The obvious place for this option would be the provider, you'd then set it in the config stage of the app:
gsapifyRouterProvider.initialTransitionEnabled = true; // false by default
Would definitely take a PR for that...
Ah ok, great have sent a PR
hey
this might be a bit hacky but:
wrapping lines 252-257 in a timeout allows passing state.data through to the self.$get function on initial app load
any chance of getting this included?
ta
EDIT: that suggested fix causes other issues, sorry ignore it