Is there a way to append a new element to a QueryList?
For example, i have a QueryList like this:
@ContentChildren(SysColumn) syscolumns: QueryList<SysColumn>;
And i need to append another SysColumn after the view init. Is it poossible on Angular? I try to append but it says that is not a function of a QueryList.
You can use reset
method
this.syscolumns.reset([...this.syscolumns.toArray(), this.additionalColumn])
Stackblitz Example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With