{
  "id": "api/core/ANALYZE_FOR_ENTRY_COMPONENTS",
  "title": "ANALYZE_FOR_ENTRY_COMPONENTS",
  "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/core\", \"name\": \"@angular/core\" } },\n            { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/core/ANALYZE_FOR_ENTRY_COMPONENTS\", \"name\": \"ANALYZE_FOR_ENTRY_COMPONENTS\" } }\n          ]\n        }\n      </script>\n        <a href=\"/api\">API</a> > <a href=\"api/core\">@angular/core</a>\n    </div>\n    <div class=\"github-links\">\n  <a href=\"https://github.com/angular/angular/edit/master/packages/core/src/metadata/di.ts?message=docs(core)%3A%20describe%20your%20change...#L51-L50\" 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/core/src/metadata/di.ts#L51-L50\" 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=\"analyze_for_entry_components\">ANALYZE_FOR_ENTRY_COMPONENTS<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/core/ANALYZE_FOR_ENTRY_COMPONENTS#analyze_for_entry_components\"><i class=\"material-icons\">link</i></a></h1>\n    \n    <label class=\"api-type-label const\">const</label>\n    <label class=\"api-status-label deprecated\">deprecated</label>\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>A DI token that you can use to create a virtual <a href=\"guide/glossary#provider\">provider</a>\nthat will populate the <code>entryComponents</code> field of components and NgModules\nbased on its <code>useValue</code> property value.\nAll components that are referenced in the <code>useValue</code> value (either directly\nor in a nested array or map) are added to the <code>entryComponents</code> property.</p>\n\n    \n  </section>\n  \n  \n<section class=\"deprecated\">\n  <p><strong>Deprecated:</strong> Since 9.0.0. With Ivy, this property is no longer necessary.</p>\n\n</section>\n\n  \n  <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading deprecated-api-item\">\n  const <a href=\"api/core/ANALYZE_FOR_ENTRY_COMPONENTS\" class=\"code-anchor\">ANALYZE_FOR_ENTRY_COMPONENTS</a>: <a href=\"api/core/InjectionToken\" class=\"code-anchor\">InjectionToken</a>&#x3C;any>;\n  </code-example>\n\n  \n\n  \n  \n\n  \n<section class=\"usage-notes\">\n  <h2 id=\"usage-notes\">Usage notes<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/core/ANALYZE_FOR_ENTRY_COMPONENTS#usage-notes\"><i class=\"material-icons\">link</i></a></h2>\n  <p>The following example shows how the router can populate the <code>entryComponents</code>\nfield of an NgModule based on a router configuration that refers\nto components.</p>\n<code-example language=\"typescript\">\n// helper function inside the router\nfunction <a href=\"api/router/provideRoutes\" class=\"code-anchor\">provideRoutes</a>(routes) {\n  return [\n    {provide: <a href=\"api/router/ROUTES\" class=\"code-anchor\">ROUTES</a>, useValue: routes},\n    {provide: <a href=\"api/core/ANALYZE_FOR_ENTRY_COMPONENTS\" class=\"code-anchor\">ANALYZE_FOR_ENTRY_COMPONENTS</a>, useValue: routes, multi: true}\n  ];\n}\n\n// user code\nlet routes = [\n  {path: '/root', component: RootComp},\n  {path: '/teams', component: TeamsComp}\n];\n\n@<a href=\"api/core/NgModule\" class=\"code-anchor\">NgModule</a>({\n  providers: [<a href=\"api/router/provideRoutes\" class=\"code-anchor\">provideRoutes</a>(routes)]\n})\nclass ModuleWithRoutes {}\n</code-example>\n\n</section>\n\n\n\n  </div>\n</article>\n\n<!-- links to this doc:\n - api/core\n - guide/deprecations\n-->\n<!-- links from this doc:\n - /api\n - api/core\n - api/core/ANALYZE_FOR_ENTRY_COMPONENTS#analyze_for_entry_components\n - api/core/ANALYZE_FOR_ENTRY_COMPONENTS#usage-notes\n - api/core/InjectionToken\n - api/core/NgModule\n - api/router/ROUTES\n - api/router/provideRoutes\n - guide/glossary#provider\n - https://github.com/angular/angular/edit/master/packages/core/src/metadata/di.ts?message=docs(core)%3A%20describe%20your%20change...#L51-L50\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/core/src/metadata/di.ts#L51-L50\n-->"
}