I want to select a component using a Directive and a id name. Is this possible ? I mean I know we can use multi selectors like this:
@ViewChild('whatever1,whatever2,etc') iMaskList: IMaskDirective<IMask.MaskedNumber>;
and I can select using a directive, like this:
@ViewChild(IMaskDirective) iMaskList: IMaskDirective<IMask.MaskedNumber>;
but how I do this ?
@ViewChild(IMaskDirective, 'whatever1,whatever2,etc') iMaskList: IMaskDirective<IMask.MaskedNumber>;
I want this because I have 2 inputs IMaskDirective and I want to be able to select one that has a specific id.
I know I can do like:
@ViewChildren(IMaskDirective) iMaskList: QueryList<IMaskDirective<IMask.MaskedNumber>>;
then
this.iMaskList.first.whatever()
or
this.iMaskList.forEach(e=>e.whatever())
But the problem is that the function I’m calling doesn’t do nothing when I use ViewChildren. So I’m trying to access one component only specifying id as this worked in other components that have only one IMask object.