Route provider in angular ngNewRouter/Angular 2 router.

188 views
Skip to first unread message

Rentius Engelbrecht

unread,
Mar 9, 2015, 11:34:45 AM3/9/15
to ang...@googlegroups.com
Hi

I'm using Angular 1.3 and want to incorporate the ngNewRouter.
Is there a way to configure the ngNewRouter when a module starts up?

I configure the routes per module as the module is created. i.e main app module has route config of "/home" or "/", I inject the $routeProvider into the config and set the routes.
The categories module configures its own routes "/categories". i.e when the module for categories is create I inject the $routeProvider into the config and set the routes.

I do not want the main module to configure the routes to categories. Each module configures its routes in isolation.

Regards

Jason Smylnycky

unread,
Mar 12, 2015, 9:03:05 AM3/12/15
to ang...@googlegroups.com
I haven't played around with it yet but have you looked at childRouter?


By the sounds of it, you could injected $router into your CategoriesController and setup routes specifically for the Categories there.

Mayur Dudhani

unread,
Nov 20, 2015, 5:17:18 PM11/20/15
to AngularJS
I was looking for the same answer and found this link: https://github.com/btford/phone-kitten 
Hope this helps somebody. 

Damien Lebrun

unread,
Nov 23, 2015, 12:42:28 AM11/23/15
to AngularJS
This is quite out of date. The new router is developed with the Angular 2 project:

https://github.com/angular/angular/tree/master/modules/angular1_router

With the upcoming release of Angular 1.5, they will hopefully soon release the new router for Angular 1.

Amit Goel

unread,
Nov 24, 2015, 6:11:34 AM11/24/15
to AngularJS
There is a angular-ui router library available as well:

I find this more flexible if you want to explore.
Reply all
Reply to author
Forward
0 new messages