BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
// assign the dataSource here
this.dropdownObj.dataBind(); // where this.dropdownObj refers to control's instance |
<ejs-dropdownlist #employees id='employees' [dataSource]='data' [fields]='fields' [popupHeight]='height'
[placeholder]='watermark'>
<ng-template #itemTemplate let-data>
<div>
<div class="ename"> {{data.FirstName}} </div>
<div class="job"> {{data.Designation}} </div>
</div>
</ng-template>
<ng-template #valueTemplate let-data>
<div>
<div class="name"> {{data.FirstName}} </div>
</div>
</ng-template>
</ejs-dropdownlist>
|
ngAfterViewInit(){
var proxy = this.dropdownlist;
document.getElementById('btn').addEventListener('click', function () {
const Http = new XMLHttpRequest();
const url = 'https://ej2services.syncfusion.com/production/web-services/api/Employees';
Http.open("Get", url);
//Http.setRequestHeader('Content-Type', 'application/json');
Http.send();
Http.onreadystatechange = function (args) {
if (Http.readyState == 4 && Http.status == 200) {
var data = JSON.parse(Http.response);
proxy.dataSource = null;
proxy.dataSource = data;
proxy.dataBind();
}
}
});
} |