Hi!

If I enter a *root-state* (like 'books') and want to *redirect to a child* 
'books.empty' or 'books.show' *depending on* the books I load through 
*$resource*... what's the correct way to do that?

*Tried resolve* - not working because the resolved values are undefined 
sometimes. Would be my first idea of a clean solution, but resolve does not 
work deterministic even for the simplest query which is always delivering 
the same results.

*Tried onEnter* - not possible because there is no way to detect the target 
state, so I have endless recursions. Apart from that there is no $scope 
there (and state parameters seem to be readonly), so I had to do the query 
twice (once for redirect, a second time for the scope and view).

*Tried controller* - working until you go back to 'books' from a child 
state (like 'books.new'). In this case the controller is not called 
(because it is already there) and the state can not be redirected to the 
right child state (which is like I think it must behave).

Endless posibilities, almost - but running out of options and no solution :D

Anybody an example somewhere or a hint how to solve this? I don't want to 
put the whole routing into ng-show tags ;)

Thank you very much in advance!

Kind regards,
Anton

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to