Hi.

If I understood correctly the question, you can use the CanDeactivate guard to implement logic to detect if a component has changes. The logic will be executed before changes to a new component.


On 08/27/2018 06:37 AM, Frank Mehlhop wrote:
Hi,

I use components and in it propertys of own models.
When I change the route I want to know the property items are manipulated or not.
(In that case there should be a warning like "You want to save changes?")

My focus is on *how to detect changes of the model object?*

Frank

What I have and use looks like...

my-model.ts
|
exportclassMyModel{myId:string,name:string,team:teamMember[]constructur(){this.team =[];}}
|

my-app.component.ts
|
import{MyModel}from'@core/models/my-model';
@Component({...})
exportclassMyApp{
myModel:MyModel;

// here I want to detect changes of myModel(e.G.at OnClose() or OnDestroy())
|

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

--
You received this message because you are subscribed to the Google Groups "Angular 
and AngularJS discussion" 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