【发布时间】:2018-05-14 00:46:15
【问题描述】:
我有一个功能,我可以在控制台中获取 id,但我无法在 Apiservice 中获取它,请谁能帮我做。
TS:
deleteProduct(index,product) {
var token = this.auth.getAccessTokenId();
this.products.splice(index, 1);
var del = this.products.splice(index, 1);
del.map(function(product) {
var Id = product.id;
console.log(Id);
})
this.ApiService
.deleteProducts(this.Id,token)
.subscribe(
products => {
console.log(products);
this.products = products;
}, error => {
//console.log(error);
})
}
直到 console.log(Id);它工作正常,但它不会出现在 ApiService 中
【问题讨论】:
标签: javascript angular typescript