Is there any method to create a childRouter in angular, just like in durandal 2.0?

The router will controll the content in ngView. In ngView, I'd like to make some childRouters which are different from router and controll some contents in ngView too.

When the childRouter changed, the url of the whole website should be changed.

The reason for using childRouter is that the childRouters are different in different ngView, and I need to organize them.

有帮助吗?

解决方案

You may want to take a look at this question: Complex nesting of partials and templates

As the most voted answer states, ng-router doesn't support child routes yet.

The Ui-Router projet may provide the features you're looking for.

I've been using it for a while and it works very well.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top