Search code examples
angularangular6resolverangular-resolver

Angular6 Resolver not working, resolver not sending data to the component


I've got a project in Angular6, and I'm using a resolver to fetch data before component gets loaded but it's not working properly. The resolver is being called but I'm not getting any data in the component.

Here the stackblitz link : https://stackblitz.com/edit/angular-ebslwf


Solution

  • I've just played with your blitz.

    It is because your app.component.html is not using a <router-outlet>

    Try this: https://stackblitz.com/edit/angular-reading-data-from-resolver?file=src/app/hello.component.ts