Recently, I delved into the world of using ViewChildren and ContentChildren in Angular 2. It got me thinking - can these be implemented in ES6 without TypeScript annotations?
The TypeScript syntax, according to the official documentation, looks something like this:
@ViewChild(ItemDirective) viewChild: ItemDirective;
Alternatively, as discussed in a forum post:
// myVideo == #my-video
@ViewChild('myVideo') myVideo: any;
I noticed that the source code contains Metadata classes for ViewChild and other similar annotations. I have a feeling it might be possible to use them in plain JS as well. However, I'm not entirely sure how to go about it. Can someone provide some guidance on this matter?