I am currently working on initializing this div using ngOnInit
in Angular
ngOnInit(): void {
let optTemp = '';
for (let data of arrOption) {
optTemp = optTemp + '<option>' + data.trim() + '</option>';
}
let sel = '<select name="select"><option value=""></option>' + optTemp + '</select>';
let Word='<div style="position: relative;display: inline-block" *ngIf='+this.show+'">'+ word + '</div>'
}
HTML :
<p [innerHTML]="Word"> </p>
In essence, my goal is to display this generated div within my html
component. Although the div
is visible in my .html
component, my intention is to initially hide it based on a condition using ngIf
.
If you have any solutions, I would greatly appreciate it. Thank you.