There is a great answer about what we can query
So we can query angular directives that match template element, but there is no directive with TextField
selector. TextField is nativescript component not angular.
Query TextValueAccessor
There is only TextValueAccessor directive but in order to query it you should honor its selector:
TextField[ngModel],TextField[formControlName],TextField[formControl],
For example, the following should work:
template
<StackLayout class="home-panel">
<TextField hint="Enter text1..." ngModel></TextField>
<TextField hint="Enter text2..." ngModel></TextField>
^^^^^^^
notice attribute here
</StackLayout>
component.ts
import { TextValueAccessor } from 'nativescript-angular/forms/value-accessors';
...
@ViewChildren(TextValueAccessor) inputs: QueryList<TextField>;
Query ElementRef
Otherwise use template reference variable:
template
<TextField #ref></TextField>
component.ts
@ViewChildren('ref') inputs: QueryList<ElemenetRef>;