Answer the question
In order to leave comments, you need to log in
How to take all options from select if options are passed to ng-content?
Good day,
There is a component
<select #select>
<ng-content></ng-content>
</select>
...
@ViewChild('select') select: ElementRef;
ngOnInit() {
console.log(this.select.nativeElement.params);
}
Answer the question
In order to leave comments, you need to log in
often ngOnInit () does not have time to pick up the data. especially if they come from the server. but ngOnChanges picks up everything. I'm not sure about ViewChild, I don't use it, but @Input will work exactly
@Input select;
ngOnChanges() {
console.log(this.select);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question