如何在打字稿中动态设置对象元素

时间:2020-04-09 12:47:36

标签: javascript angular typescript

paper.on('blank:pointerup', function (cell) {
    alert("hello");
});

在这里,我想用filterForElement: string constructor( private api: someApiService) { } someInitFunction(params:any) { this.filterForElement = params.filterForElement // Value is available onece component is initialize. } onChangeDrop() { this.api.setFilterModel({'state': {filterType: "text", type: "equals", filter: valueToUse}}) } 值代替状态。

1 个答案:

答案 0 :(得分:0)

尝试这样:

this.api.setFilterModel({this.filterForElement: {filterType: "text", type: "equals", filter: valueToUse}})
相关问题