How do you route to controllers registered with Module#controller?

258 views
Skip to first unread message

Nick R

unread,
Apr 6, 2012, 9:25:41 PM4/6/12
to ang...@googlegroups.com
If I register controllers with Module#controller, how can I use those controllers when I configure the routing like in the example?  Do I inject them into the config?  Is that even possible?  Or should I be passing surrogates for them into my $routeProvider.when statements?

Peter Bacon Darwin

unread,
Apr 7, 2012, 1:09:06 AM4/7/12
to ang...@googlegroups.com
Simply refer to them as strings: http://jsfiddle.net/sLBr7/

On 7 April 2012 02:25, Nick R <nickre...@gmail.com> wrote:
If I register controllers with Module#controller, how can I use those controllers when I configure the routing like in the example?  Do I inject them into the config?  Is that even possible?  Or should I be passing surrogates for them into my $routeProvider.when statements?

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/isW6UH8fTyQJ.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.

Reply all
Reply to author
Forward
0 new messages