5 lines
16 KiB
JSON
5 lines
16 KiB
JSON
|
{
|
||
|
"id": "api/router/RouterModule",
|
||
|
"title": "RouterModule",
|
||
|
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/router\", \"name\": \"@angular/router\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/router/RouterModule\", \"name\": \"RouterModule\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/router\">@angular/router</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/router/src/router_module.ts?message=docs(router)%3A%20describe%20your%20change...#L72-L174\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/router_module.ts#L72-L174\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"routermodule\">RouterModule<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterModule#routermodule\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label ngmodule\">ngmodule</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>Adds directives and providers for in-app navigation among views defined in an application.\nUse the Angular <code><a href=\"api/router/Router\" class=\"code-anchor\">Router</a></code> service to declaratively specify application states and manage state\ntransitions.</p>\n\n <p><a href=\"api/router/RouterModule#description\">See more...</a></p>\n </section>\n \n \n \n <section class=\"ngmodule-overview\">\n<code-example language=\"ts\" hidecopy=\"true\">\nclass <a href=\"api/router/RouterModule\" class=\"code-anchor\">RouterModule</a> {\n <a class=\"code-anchor\" href=\"api/router/RouterModule#forRoot\">static <span class=\"member-name\">forRoot</span>(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterModule></a>\n <a class=\"code-anchor\" href=\"api/router/RouterModule#forChild\">static <span class=\"member-name\">forChild</span>(routes: Routes): ModuleWithProviders<RouterModule></a>\n}\n</code-example>\n\n \n \n\n</section>\n\n\n \n<section class=\"see-also\">\n <h2 id=\"see-also\">See also<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterModule#see-also\"><i class=\"material-icons\">link</i></a></h2>\n <ul>\n \n <li><p><a href=\"guide/router\">Routing and Navigation guide</a> for an\noverview of how the <code><a href=\"api/router/Router\" class=\"code-anchor\">Router</a></code> service should be used.</p>\n</li>\n </ul>\n</section>\n\n\n \n \n \n<section class=\"description\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterModule#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>You can import this NgModule multiple times, once for each lazy-loaded bundle.\nHowever, only one <code><a href=\"api/router/Router\" class=\"code-anchor\">Router</a></code> service can be active.\nTo ensure this, there are two ways to register routes when importing this module:</p>\n<ul>\n<li>The <code>forRoot()</code> method creates an <code><a href=\"api/core/NgModule\" class=\"code-anchor\">NgModule</a></code> that contains all the directives, the given\nroutes,
|
||
|
}
|