updatable topping
This commit is contained in:
parent
ecd88b2e27
commit
cfd5c723c0
1 changed files with 3 additions and 1 deletions
|
|
@ -278,11 +278,13 @@ export class RecipeDetailsComponent implements OnInit {
|
||||||
|
|
||||||
// check length of toppinglist
|
// check length of toppinglist
|
||||||
console.log("tpl length", this.tpl.length, "original length", (this.rawRecipe! as any).ToppingSet.length);
|
console.log("tpl length", this.tpl.length, "original length", (this.rawRecipe! as any).ToppingSet.length);
|
||||||
|
|
||||||
for(let ti = 0; ti < this.tpl.length; ti++){
|
for(let ti = 0; ti < this.tpl.length; ti++){
|
||||||
// check at the same index
|
// check at the same index
|
||||||
if(!isEqual(this.tpl[ti][0], (this.rawRecipe as any).ToppingSet[ti])){
|
if(!isEqual(this.tpl[ti][0], (this.rawRecipe as any).ToppingSet[ti])){
|
||||||
console.log('topping list changed', ti, this.tpl[ti][0], (this.rawRecipe as any).ToppingSet[ti]);
|
console.log('topping list changed', ti, this.tpl[ti][0], (this.rawRecipe as any).ToppingSet[ti]);
|
||||||
|
// update raw recipe
|
||||||
|
(this.rawRecipe as any).ToppingSet[ti] = this.tpl[ti][0];
|
||||||
|
console.log('after update topping', (this.rawRecipe as any).ToppingSet[ti]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue