I'm trying to ask by the type or class required to add an item in an Array using typescript, I tried this.
I wan't to build a loop to build buttons to add an element to arrays attributes whose extends from a parent common class example, GenericItem
Class Item extends GenericItem
End
The Main Class
Class mainClass
items: Array<Item>();
...
// Many of arrays
End
Iterating the arrays and create buttons
// Loop each of GenericItem Arrays
let add_btn = document.createElement('button');
add_btn.onclick = (e) => {
// Add an object item to array using the correct class
}
// end loop