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:
Igor Minar 2021-05-27 14:15:25 -07:00 committed by Andrew Kushnir
parent 4cd2cc439d
commit 184de5048a
1 changed files with 6 additions and 1 deletions

View File

@ -16,7 +16,12 @@ import {standardizeConfig} from './utils/config';
/** /**
* The [DI token](guide/glossary/#di-token) for a router configuration. * 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 * @publicApi
*/ */
export const ROUTES = new InjectionToken<Route[][]>('ROUTES'); export const ROUTES = new InjectionToken<Route[][]>('ROUTES');