Hello
What would be the good way to share model in application?

There is list of objects from server. These objects should be:
a) Displayed in views (different states). Sometimes I need to add data to 
these objects. E.g. 'disabled', so it could be displayed properly; 'name', 
that come from other objects based on ID,; etc.
b) Modify object on view (without saving to backend) and revert back.
c) Save to backend (PUT/POST).

I know several ways to solve it:
1. For each object type create "model", that have defined list of fields 
and their types. So when i do put/post i could exclude all other extra 
fields.
2. Create copy of list for each view(controller), and then update that list 
when data updated froms server (e.g. using watch).

What option is better, and are there any other options?

-- 
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