Skip to content Skip to sidebar Skip to footer

Angular2 Error While Resolving Promise: Type 'Promise' Is No T Assignable To Type 'Hero[]'

Updated. I am Following Angular2 tutorial from https://angular.io/docs/ts/latest/tutorial/toh-pt4.html Here is the call to HeroService from heroes.component.ts, Heroes.component.

Solution 1:

Changing heroes: Hero[]; to heroes: any; resolves the issue, however the console returns an error because ngFor supports only iterables. At the end, the code compile and the app runs but there's this tiny issue that I find disrupting.


Post a Comment for "Angular2 Error While Resolving Promise: Type 'Promise' Is No T Assignable To Type 'Hero[]'"