angular-resolver

Resolver Emitting Error ` ERROR Error: “[object Object]” `

烂漫一生 提交于 2019-11-29 01:46:59
问题 I'm having a problem with regards of implementing a resolver on my routes as it has no issue until I include InitialDataResolver on my routing module. pages-routing.module.ts import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { FrontComponent } from '../layouts/front/front.component'; import { HomeComponent } from './home/home.component'; import { DocsComponent } from './docs/docs.component'; import { InitialDataResolver } from './..

Why would you use a resolver with Angular

为君一笑 提交于 2019-11-28 18:34:06
问题 I like the idea of resolver s. You can say that: - for a given route you expect some data to be loaded first - you can just have a really simple component with no observable (as retrieving data from this.route.snapshot.data ) So resolvers makes a lot of sense. BUT: - You're not changing the URL and displaying your requested component until you receive the actual response. So you can't (simply) show the user that something is happening by rendering your component and showing as much as you can