After searching through countless forums, I have yet to find a satisfactory answer to my problem. As a newcomer to Angular, I am struggling to grasp the concept of lifecycle hooks.
I'm working with a Parent Window that contains a component where I set the value of the window:
<app-acciones [window]="selectedWindow"></app-acciones>
Within the child component, I have an input for this window and an array where I intend to store the values of a function I wish to subscribe to:
@Input() window:Window;
Actions:Action[];
totalActions:number; //this part is functioning correctly
Here is the method I am using:
getActions(){
this._actionService.getAction(this.window)
.subscribe(
actions => {
this.totalActions = actions.total; // this part works fine
this.Actions = actions.actions; // this is where the error occurs
}
);
}
ngOnChanges(){
this.getActions();
}
Despite the fact that the code seems to be functioning "correctly", I am puzzled by the error that keeps occurring. Any help in understanding and resolving this issue would be greatly appreciated as it is frustrating not knowing why this occurs and how to fix it.