I'm encountering an issue with assigning values to variables in my code. Can anyone provide assistance in finding a solution?
Here is the snippet of my code:
app.component.ts:
public power:any;
public ice:any;
public cake:any;
changeValue(prop,val) {
this[prop]=val;
console.log(this[prop]);
}
this.changeValue("power","124525");
this.changeValue("ice","125658");
this.changeValue("cake","122568");