Answer the question
In order to leave comments, you need to log in
How to work with change detection?
I can’t understand, here I have an array in the object
private obj = {
arr: []
}
This object is in the service, when I add data to it
In the component that is connected to this service , change detection immediately fires and my data is drawn.
But if suddenly, I do a cleanup of this array
Then when I write to this array again, the detection of changes on this array does not work, and new data is not drawn.
Similarly, if I have an array with objects
obj.arr.push(1)
obj.arr = []
arr = [
{id:1,name:'Вася'},
{id:2,name:'Петя'},
...
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question