I am trying to create variable in my component of certain type like below.
myrequest.model.ts
export class MyRequest {
public endValue: string;
public yearEnd: string;
}
In my component i import the above and do like below
myReqObj: MyRequest;
But if i try to do like
this.myReqObj.endValue = '23'
it trows a error like myReqObj is undefined. Am i doing the right way? What is the right way to do this.