I have an array of objects with properties name and age. Name of the array is person.
Problem is when i update the property of an element of array as :
this.person[0].name = "godfather";
original array is updated but component view remains as it is. I figured out the problem is angular change detection doesn't consider updation inside an array as a change. So, i tried below statement (changes reference to array):
this.person = this.person.slice();
I just want to know, Is using the later statement a good practice or there is some better approach to deal with the above problem?