Clientlist.service.ts角2:如何得到服务响应数据绑定到下拉
getClientList()
{
let headers = new Headers();
headers.append('Content-Type', 'application/json');
let authToken = localStorage.getItem('auth_token');
console.log(authToken);
headers.append('X-auth-Token', authToken)
return this._http.get('http://localhost:8080/api/v1/client/list?isClient=Y', {headers})
.map((res) => {
var clientList = res;
console.log(clientList);
})
}
响应:
[{"userId":"mind.com","clientCode":"75","clientName":"ABC COMPANY, THE"},{"userId":"mind.com","clientCode":"51","clientName":"infotech"}]
这里我得到的客户名单中的客户端列表,现在怎么我可以将此响应绑定到角度下拉列表中。请帮助我。
可能的重复[如何在“选择”Angular 2中获得新选择?](http://stackoverflow.com/questions/33700266/how-can-i-get-new-selection-in- select-in-angular-2) –