I'm trying to update a model of type 'SomeModel' in a list of elements of type SomeModel[]
I'm trying to point to the object needed as follow:
onChange(args: SomeModel): void {
let element: SomeModel = this.elements.find(e => e.name === args.name);
console.log(element) // <-- this prints the right object from the list
element = JSON.parse(JSON.stringify(args)); // <-- isn't working
}
What I'm doing wrong?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…