Hello guys,

I have an architectural question about Angular.
I'm creating small application, which manipulates items (let's say abstract 
items), user can see a list, add, edit, and delete them.
There are two views: "list" and "add", I switch between them with ng-view 
directive. I have the following controllers:
MainController, ListController (for "list" view), AddController (for "add" 
view). In "add" view user see another list of "last added" items.
I put "list" logic (load items from server) to ListController. I put "add" 
logic to AddController.

But in both views user can edit and delete items, in case of "add" view I 
can add and delete items in "last added" list (which reflects in main 
"list" too).
Where do I need to put edit and remove logic part? In MainController 
because it is common? Or do I need to use service for
manipulate lists? I don't know how to create good architecture for these 
parts.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to