我试图在这个网址中插入参数,但我无法让它工作。这是我的代码:
filterFunction(newValue, parameter){
this.workorderservice.searchWorkorders(1, 20, {sort: {}, search: {predicateObject: {'workorder.location.street': newValue}}, pagination: {start: 0}})
.subscribe(data =>{ this.rows = data.json()
this.links = this.parselink.parse(data.headers.get('link'))
console.log(this.rows)
})
}
我尝试替换' workorder.location.street'使用参数
答案 0 :(得分:2)
您不能使用这样的参数名称。即使你的问题有点模糊,我想你应该这样做:
filterFunction(newValue, parameter) {
let predicateObject: any = {};
predicateObject[parameter] = newValue;
this.workorderservice.searchWorkorders(1, 20, {sort: {}, search: {predicateObject: predicateObject}, pagination: {start: 0}})
.subscribe(data =>{ this.rows = data.json()
this.links = this.parselink.parse(data.headers.get('link'))
console.log(this.rows)
})
}