【发布时间】:2019-01-24 12:02:26
【问题描述】:
我正在开发一个国家、州、城市可靠的下拉列表,我需要根据国家/地区填充州详细信息,但我无法过滤它。谁能帮我解决这个问题。我收到以下错误
“订阅”类型上不存在属性“过滤器”。
onSelectCountry(country_id: number) {
this.selectedCountry = country_id;
this.selectedState = 0;
this.cities = [];
this.states = this.getStates().filter((item) => {
return item.country_id === Number(country_id)
});
}
getStates() {
return this.http.get("https://api.myjson.com/bins/1a72vg").subscribe(
response => {}
);
}
【问题讨论】:
标签: angular