In my angular application, i pass an object todo
down to a child component via Input, which contains an array of strings at todo.tags
. I now want to modify this array and therefore snap a copy of it and assign to a new variable like this:
@Input() todo: ITodos
public tags: Array<string> = [...this.todo.tags]
But i get the Error "property is used before initialization" which makes sense because i only declare todo
. But i dont know how or for what i should initialize an Input, because the value is the input