0
更新我有一個成員:值不會在瀏覽器中
airline = 'string';
而且在我的模板,我有:
<p>{{airline}}</p>
顯然,這顯示了在瀏覽器string
。
我有一個函數:
setValue(selectionChangedEvent) {
this.airline = selectionChangedEvent.selectionChanges[0].selected[0].properties.airline;
console.log(this.airline);
}
此功能從名爲:
this._map.on('SelectionChanged', function (selectionChangedEvent) {
if (selectionChangedEvent.selectionChanges.length > 0) {
var c = new MapComponent();
c.setValue(selectionChangedEvent);
} else {
}
});
當我運行的代碼,我看到的this.airline
中的setValue函數值,但該值在瀏覽器中仍然是string
。
爲什麼它不在瀏覽器中更新?
所有的功能都在同一個組件中嗎? – Moema