Nesting ng-views in angular js

前端 未结 6 585
失恋的感觉
失恋的感觉 2020-12-02 12:14

I had two different apps in angular. During integration to a single application I had to

nest ng-views.

For sample (index.html) is



        
6条回答
  •  执念已碎
    2020-12-02 12:42

    Updated answer:

    UI Router (which now sits here: https://angular-ui.github.io/ui-router/site/#/api/ui.router) is generally regarded as the best solution for complex routing in AngularJS.


    Original answer:

    Nesting views isn't natively possible, as of now, in AngularJS. In my last app, I used a solution derived from here: http://www.bennadel.com/blog/2420-Mapping-AngularJS-Routes-Onto-URL-Parameters-And-Client-Side-Events.htm

    Allowing me to effectively nest views (and skipping the limited ng-view altogether)

    After doing so, this other (simpler, better, I believe) solution appeared:

    http://angular-ui.github.com/ (scroll down to "Route Checking")

    Check it out!

提交回复
热议问题