我有一個textarea,我試圖將更新推送到該字段。我似乎無法弄清楚如何做到這一點。我成功地讓我的組合框將選定的項目傳遞給dropdownSourceSelected。從那裏,我想: 1)更新textarea的領域 2)清除組合框的值(它使佔位符返回組件角度更新textarea字段
我無法弄清楚如何做到這一點返回不確定我看到引用使用$範圍但是當我嘗試這樣做我得到了約$範圍是未知的錯誤
table-widget.component.html
<textarea vertical-align:top ng-model="filterSelection" readonly name="selectedfilters" cols = "50" rows = "1"></textarea>
table.component.ts
public dropdownSourceSelected(selection: string): void {
if (this.filterSelection != '')
this.filterSelection += '&';
this.filterSelection += "source=";
this.filterSelection += selection;
console.log('filter selection: ', this.filterSelection);
}
哪個版本的棱角分明是這樣嗎? – DeborahK
我做了這個改變後我們使用Angular 2 – efultz