Forum


HomeHomePremiumPremiumDevelopmentDevelopmentQuestion about Angular app structureQuestion about Angular app structure
Previous
 
Next
New Post
5/3/2015 9:10 AM
 

I'm in the process of building a more complex application using the Angular example as a base. What's not completely clear in the example is what to do when you have more tables. In the "good old days" you'd have a List.ascx, View.ascx and Edit.ascx for each table and that was pretty much it. If you had a lot of tables you ended up with a lot of pages, but structure and navigation was pretty simple.

Using Angular I see the view.ascx has the list, view and edit capabilities as panels. These are managed by the item-app.js. What happens when table #2 comes along? Does everything go into view and a single js,  or do I create one per table?

COnsider this structure:

 

contacttype <- contact   ->  registration   <-  event -> eventtype

 

How would you recommend that be structured?

   

 
New Post
5/4/2015 2:29 PM
 

Keith,

I think I would start by organizing your project like this:

Data Layer

  • Contact Model/Repository
  • Event Model/Repository
  • Registration Model/Repository

The contacttype and eventtype data can be probably rolled into the contact and event models

Service Layer

  • ContactController: create, get, list, update, etc
  • EventController: create, get, list, update, etc
  • RegistrationController: create, get

Angular Modules

  • contact-app.js: contact module, contact controller
  • event-app.js: event module, event controller
  • registration-app.js: registration module, registration controller
  • dnnservice-factory.js: just the dnnServiceClient factory from my item-app that is shared by above 3 controllers.

For the views, you could either research how to use the MVC partials in Angular to have a true single page application that runs from a single module view (.ascx).  But it may not be necessary if these module views are very distinct and will likely need to be actual separate module definitions or .ascx module views.  You could create 3 module views: contact.ascx, event.ascx, and registration.ascx and isolate their angular module/controller to work with that view to do list/create/update/delete like in my Item example.  

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentQuestion about Angular app structureQuestion about Angular app structure



Try FREE
30 days money back guaranteed