In my view i'm rendering a list of skills, using an observable and *ngFor
I retrieve the skills with the following code:
getSkills(): void {
this.skillsDataService.getSkills()
.subscribe(
skills => this.skills = skills.sort( this.skillSort )
);
}
However i've learned that it's better to use named functions and not too much nesting. So i changed the code to this:
getSkills(): void {
this.skillsDataService.getSkills()
.subscribe(
this.processSkills
);
}
processSkills(skills: Skill[]): void {
this.skills = skills.sort( this.skillSort );
}
And now the view doesn't update, eventhough this.skills is filled.