I have a service in angular, where I stored an array called array_item
obtained from my api call and in the component I declared 2 variables called var_1
and var_2
where both have the same value which I've obtained from the service
i.e: var_1 = this.service.array_item
&& var_2 = this.service.array_item
I'm listing it in my HTML as lists of 2 DIVs but when I update the value in the list_1 it changes the array item value in service which automatically changes my array item data in list_2. I don't want list 2 to get changed I want it to be constant. Suggestions or solutions are welcome.
Thanks in advance