I want to populate data in my select control which is placed in the header child component, but data comes from the API, but it does not display.
ngOnInit() {
this._assingedSiteService.getAssignedSitesForLogInUser().subscribe(
(res) => {
this.sites = res;
console.log(this.sites);
},
(error) => {
console.log(error);
}
);
}
<li class="nav-item">
<select class="form-control">
<option *ngFor="let site of sites">
{{site.siteName | json}}
</option>
</select>
</li>