I've encountered an issue while working on my Angular component. Here's the relevant code snippet:
class Test implements ....{
duration:{from:number, to:number}
constructor(){
this.duration.from = "ddd";//set after some calculations
this.duration.to = "ddd";
}
}
When I run this code, it throws an error saying "cannot set property from
of undefined".
Can anyone help me figure out what I'm doing wrong here?