[app.component.html]
<ejs-dropdownlist id='remoteData' #remote [dataSource]='data | async' [filterType]='filterType' [allowFiltering]='true'
[fields]='remoteFields' [placeholder]='remoteWaterMark' sortOrder='Ascending'></ejs-dropdownlist>
[app.component.ts]
@ViewChild('remote')
public multiselectObj: DropDownListComponent;
public data: any;
constructor(private http: HttpClient) {
}
ngOnInit() {
this.getData();
}
public getData() {
this.data = this.http.get<{ [key: string]: object; }[]>('https://services.odata.org/V4/Northwind/Northwind.svc/Orders').pipe(
map(data => {
return (<any>data).value;
})
);
}
public remoteFields: Object = { text: 'CustomerID', value: 'CustomerID' };
// set the placeholder to MultiSelect input element
public remoteWaterMark: string = 'Select names';
public filterType: any = 'Contains';
@ViewChild('remote')
public multiselectObj: DropDownListComponent;
public data: any;
constructor(private http: HttpClient) {
}
ngOnInit() {
this.getData();
}
public getData() {
this.data = this.http.get<{ [key: string]: object; }[]>('https://services.odata.org/V4/Northwind/Northwind.svc/Orders').pipe(
map(data => {
return (<any>data).value;
})
);
}
public remoteFields: Object = { text: 'CustomerID', value: 'CustomerID' };
// set the placeholder to MultiSelect input element
public remoteWaterMark: string = 'Select names';
public filterType: any = 'Contains';
|