I am declaring an array on a provider @Injectable to use it in different components.
normeList: any[] = [
{
name: 'choice 1',
type:'false'
},
{
name: 'choice 2',
type:'false'
}
];
On the component, I assigned that array like this:
this.myArray = [].concat(this.sharedListDeclarationProvider.normeList);
on the view, I am working with the myArray and I am changing the type on the myArray from false to true;
the problem is that 'myArray' on the component and normList declared on the provider also changing.
How can I change the value of the myArray without changing the normeList