angularjs ui-router - how to build master state which is global across app

前端 未结 3 981
[愿得一人]
[愿得一人] 2020-12-02 05:30


...


  
3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 06:01

    Although confusing, the FAQ in the ui-router wiki seems to say that this isn't possible: ui-router/wiki/faq

    One approach is to allow each feature to define it's own root state (as in this example: AngularJS State Management with ui-router)

    Another would be to define the entire state hierarchy in your "myApp" module and just leverage controllers etc. from the dependent modules. This works especially well when you are maintaining a mobile and desktop site; define each site's state hierarchy in a mobileApp and desktopApp module, and have the functionality (e.g. controllers, services, etc.) shared in separate modules.

提交回复
热议问题