I am working on an application which contains tabs. I have managed the tab navigation in the app by changing the content in ng-view upon tab change. But I have a page in those tabs which again contains tabs. As I can't have 2 ng-view's in a single app, I am facing a difficulty. I have included all the tabs and their respective divisions using ng-repeat. The visibility respective content of all tabs in controlled by ng-show/hide. But here, every time the tab changes URL will also change(using routes). That leads to a $http request to server on each tab change. Can anyone suggest me a better alternative? I will share the code upon request.
1 Answer
Angular UI Router would be your only alternative. It allows you to have nested views. UI Router allows for nested views and multiple named views. This is very useful with larger app where you may have pages that inherit from other sections. ngRoute merely allows you to assign controllers and templates to URL routes, whereas the fundamental abstraction in UI Router is states, which is a more powerful concept.
ui-routerwhich allows nested views as well as parent states. Initial conversion fromngRoutewon't require huge changes to routing config.