pcproff
pcproff

Reputation: 622

Architectural advice on my angular.js app

I am using an API service call to build my navigational content & view content throughout the application. My first question is

  1. Should I separate the json for the navigation and the json for the rest of the layout?
  2. If so, how could I tie the element I am clicking on to the portion of the json file for the rest of view layout? (ie.routes, jlite data())?

The other option I was thinking of was using one json then file having to do object and array cleanup due to the menu system wanting a clean {[]} type format and then continue looping and adding content into the view but, I fear keeping track of all of these views can be a headache.

So to sum up, I have a left hand navigation using json to be built and each one of those child level items in the nav call different portions of the json to populate the u/i using a ng-repeat directive and any parent element would call and get a json response that I will have to keep track of what was clicked and where in the response to stop to generate to populate the view. This is hard to think of in the angular way of thinking so I hope I posted this in the correct area and that it should not be in code review overflow.

Upvotes: 0

Views: 38

Answers (1)

Icycool
Icycool

Reputation: 7179

I think ui-router suits your need. It is a bit difficult when you start, though.

http://angular-ui.github.io/ui-router/sample/#/

Upvotes: 1

Related Questions