0

I have a class of object

Class file (consumption.ts)

export class ConsumptionDetails {
Id: string;
Status: string;
Description: string;
Quantity: number;
}

Function 1: (consumption.component.ts)

this.lineItems$.subscribe((result: BindingState<ConsumptionDetails>) => {
 if(result){
   this.tempObj = result;
 }
}

Function 2: (consumption.component.ts)

this.tempObj.Status = 'Submitted';
console.log(this.tempObj);

Here 'Submitted' status not updated with 'tempObj.Status', Instead of I am getting error

ERROR TypeError: Cannot add property Status, object is not extensible
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.