The resolve property associates route names with resolver functions and delays route activation until the resolver’s result is ready. Its map keys are arbitrary; the values determine which resolvers run. section 26.2.1
Configure a resolver by:
- Registering the resolver service in the feature module. section 26.2.1
- Adding a resolve map to the route, such as { model: mapToResolve(ModelResolver) }. section 26.2.1
- Placing the property on a parent route when several child routes require the same data. section 26.2.1
- Returning an Observable, Promise, or other result; navigation waits for the first two and proceeds immediately for other results. section 26.2.1
Load the model before product routes activate
A parent route can apply resolve: { model: mapToResolve(ModelResolver) } to product and category child routes. The resolver waits until products arrive, preventing the table from appearing empty; a message service can display loading feedback meanwhile. section 26.2.1
