0
我有下面的代碼,我試圖從選定的值創建一個字符串。爲什麼價值沒有得到在打字稿中分配?
this.selectedCategory = selectedvalue.name;
this.filter = '{category:${this.selectedCategory}}';
的this.filter
值是{category:${this.selectedCategory}}
而我期待的輸出作爲{category:Music}
。
其作爲字符串處理插值。使用模板特定的引號。 – Nirus