Sam
Sam

Reputation: 14586

angularjs: tabbed view design issue

[EDIT]

Similar question to Complex nesting of partials and templates

As of now, is it better to use Angular-UI state solution or should I stick with ng-includes ?


So far I had one view per URL in my AngularJS application. I need to build a new view, which should have 3 tabs and I'm having troubles trying to figure out how I'm going to design the view - architecture-wise that is.

Note that the business model object behind these 3 tabs is the same one.

The first tab is for viewing and editing data on the business object. So that's already two 'views' within the first tab.

The second tab is for viewing a paged-table showing data from a child collection of the business object.

The third tab does the same thing as the second one but for another child collection.

Obviously, I do not want to load the entire business object at once. I'll load the collections only if the user navigates to the 2nd or 3rd tabs.

My main concern right now is how am I going to organize the views ? AngularJS has this limitation of only 1-view per page.

Also, I need to handle browser history, so the URL must change when a tab is selected, but I should have to reload any data (i.e I must not reload the controller).

Any tips would be much appreciated.

Upvotes: 3

Views: 1267

Answers (1)

Sam
Sam

Reputation: 14586

For the record, I ended up using ui-router and its state management, which is awesome. It took me a bit of time to understand the concepts and to put that in practice, but I managed to build a pretty complex set of layouts effortlessly !

Upvotes: 2

Related Questions