2

I am new to AngularJs. I am working in Angular Routing Concept. There are plenty of suggestion and examples are available for Routing and i am researching it. But its not fulfilling my requirement. I want to Design one Parent controller in JSP page which has header,footer and ng-view. In ng-view, Two Tab(Tab1.html and Tab2.html) has to display,the Parent controller has to choose which tab is currently active (this case is important and i dont have any idea how to do this). Tab 1 and Tab2 have each html page with seperate sub controllers.

why i am not inserting the Bootstrap Tab in ng-view section means, above the each tab there are some other view has to display, for example, if tab1 is active, button1, label1 has to display above the tab1 and if tab2 is active, button2, label2 has to display above the tab2.So I suggest to use the Bootstrap tab for both the html page which has to display in the ng-view.

enter image description here

I don't know i explained you clearly,please suggest me with some templates which fulfilling my requirement.

Thanks in advance

1 Answers1

0

Angular UI Router handles this very well. Here's a good intro to using UI Router.

Basically, there would be a top-level state representing the entire page which controls the header and footer and the ui-view (which replaces the ng-view). There will be two child states of the top-level state which will control the content being shown dependent on which of the tabs (states) is active. Each state will have its own controller and view, which means that they can all be maintained separately and you can change the button in the header based on which state is clicked very easily.

Ryan Hamley
  • 1,989
  • 1
  • 15
  • 12