I am currently working on implementing a custom multi drag-and-drop feature into my Angular application. Within one of the services, I am looping through an array of host components called <app-cell>
.
While iterating through the array of 's, I am wondering if there is a way to specify a "custom typing" for my iterative variable. In simpler terms, how can I restrict the type of tile to app-tile?
The code snippet below does not represent the exact implementation but captures the essence of what I am aiming for:
let selectedTiles = Array.from(document.querySelectorAll('app-tile'));
selectedTiles.map((tile: **WHAT GOES HERE?**) => {
// do something with tile
}
I have utilized models in the past to define 'custom typing' for simple objects with specific keys. However, I am unsure about how to approach narrowing down the assignment for my own Angular component.
After researching online, I believe TemplateRef or directives might provide some insight, but I require guidance on which typing would be suitable for my use case. Thank you!