Hi Everyone,
I  am working on a Angular 6 application which has layout component(parent)
and MatterComponent as (child) ,
i am calling the function of the child component from parent component ,
and it works i can se the function working the data in the .ts file has
being changed.
but the child component is already initailized and the ngFor is not
updating the DOM. with the new value.

please help.

thanks ,
Rohit.
below is the code:

//parentComponent
if(result.value === true){
this.snackbar.open(`${this.terminlogies.L1} ${result.addmsg} sucessfully`,
'close', {
duration: 4000
});
this.mattercomponent.groupFind;
this.mattercomponent.matterFind;
}

//ChildComponent
groupFind(){
this._group.find({
where: {
active: true,
},
include: {
relation: 'clients',
scope: {
include: {
relation: 'matters',
}
}
}
}).subscribe((res:any)=>{
this.groups_data=res;
let clientList = [];
let matterList = [];
res.forEach(function(group:any){
group.clients.forEach(function(client){
clientList.push(client);
client.matters.forEach(function(matter){
matterList.push(matter);
})
})
})
this.clients_data=clientList
this.matter_data=matterList
console.log(groups_data)<--
can see it in console but DOM is not updated.
},
err=>{
console.log(err)
}
)
}


//childComponent HTML
<div *ngFor="let group of groups_data | sort:groups_data:sortProperty">

-- 
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 angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to