mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs: expand documentation for ROUTES (#42398)
Previously the docs were very minimalistic. The most important thing missing from the docs was that people should primarily use higher level APIs instead of using ROUTES directly. It would be nice to holistically overhaul more of the router API docs, but that's out of scope of this change. Fixes #39350 PR Close #42398
This commit is contained in:
parent
2736465c61
commit
644ef7a785
1 changed files with 6 additions and 1 deletions
|
|
@ -16,7 +16,12 @@ import {standardizeConfig} from './utils/config';
|
|||
|
||||
/**
|
||||
* The [DI token](guide/glossary/#di-token) for a router configuration.
|
||||
* @see `ROUTES`
|
||||
*
|
||||
* `ROUTES` is a low level API for router configuration via dependency injection.
|
||||
*
|
||||
* We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`,
|
||||
* `RouterModule.forChild()`, `provideRoutes`, or `Router.resetConfig()`.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const ROUTES = new InjectionToken<Route[][]>('ROUTES');
|
||||
|
|
|
|||
Loading…
Reference in a new issue