Есть такой код
return this.http.put(url, {product: product}, {headers: this.getHeaders()})
.map(response => {
return response.json() as Product;
})
.catch(this.handleError.bind(this));
product = { ... unit = {id:null, name:''} }
Перед отправкой мне нужно сделать так
product.unit = product.unit.id
Но Typescript мне естественно так сделать не даст, как быть?