You are right concerning the fact components should not contain data. But 
on the other hand the components actually contain the forms which again 
contain the dirty state, so the state is already there. 
I think I will go for your proposed service approach.

Thanks, 

  Pelle

Am Freitag, 1. Juli 2016 07:34:08 UTC+2 schrieb Sander Elias:
>
> Hi Pelle,
>
> First of all, components should not keep data at all! Data belongs in 
> services. The same thing goes for state (amIDirty is a state!) 
> I would create a service where I would keep a registry of components that 
> are 'dirty', each component can then manage it's own dirty state, and aso 
> provide a 'save' or 'reject' method in the same registry. Also it can 
> remove itself once it becomes 'clean' again.
>
> Regards
> Sander
>

-- 
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to