5 lines
3.2 KiB
JSON
5 lines
3.2 KiB
JSON
{
|
||
"id": "errors/NG0301",
|
||
"title": "NG0301: Export not found!",
|
||
"contents": "<h1 id=\"ng0301-export-not-found\">NG0301: Export not found!<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0301#ng0301-export-not-found\"><i class=\"material-icons\">link</i></a></h1>\n<div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/aio/content/errors/NG0301.md?message=docs(...)%3A%20describe%20your%20change...\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n</div>\n\n\n<div class=\"error-video-container\">\n <iframe src=\"https://www.youtube.com/embed/fUSAg4kp2WQ\" frameborder=\"0\" allow=\"accelerometer; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n</div>\n\n\n\n<div class=\"content\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0301#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>Angular can’t find a directive with <code>{{ PLACEHOLDER }}</code> export name. The export name is specified in the <code>exportAs</code> property of the directive decorator. This is common when using FormsModule or Material modules in templates, and you’ve forgotten to <a href=\"guide/sharing-ngmodules\">import the corresponding modules</a>.</p>\n<div class=\"alert is-helpful\">\n<p>This is the runtime equivalent of a common compiler error <a href=\"errors/NG8003\">NG8003: No directive found with export</a>.</p>\n</div>\n\n</div>\n<br>\n<div class=\"debugging\">\n <h2 id=\"debugging-the-error\">Debugging the error<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0301#debugging-the-error\"><i class=\"material-icons\">link</i></a></h2>\n <p>Use the export name to trace the templates or modules using this export.</p>\n<p>Ensure that all dependencies are <a href=\"guide/sharing-ngmodules\">properly imported and declared in your NgModules</a>. For example, if the export not found is <code><a href=\"api/forms/NgForm\" class=\"code-anchor\">ngForm</a></code>, we need to import <code><a href=\"api/forms/FormsModule\" class=\"code-anchor\">FormsModule</a></code> and declare it in the list of imports in <code>*.module.ts</code> to resolve the error.</p>\n<code-example language=\"typescript\">\nimport { <a href=\"api/forms/FormsModule\" class=\"code-anchor\">FormsModule</a> } from '@angular/forms';\n\n@<a href=\"api/core/NgModule\" class=\"code-anchor\">NgModule</a>({\n ...\n imports: [\n <a href=\"api/forms/FormsModule\" class=\"code-anchor\">FormsModule</a>,\n …\n</code-example>\n<p>If you recently added an import, you may need to restart your server to see these changes.</p>\n\n</div>\n\n<!-- links to this doc:\n - errors\n - errors/NG8003\n-->\n<!-- links from this doc:\n - api/core/NgModule\n - api/forms/FormsModule\n - api/forms/NgForm\n - errors/NG0301#debugging-the-error\n - errors/NG0301#description\n - errors/NG0301#ng0301-export-not-found\n - errors/NG8003\n - guide/sharing-ngmodules\n - https://github.com/angular/angular/edit/master/aio/content/errors/NG0301.md?message=docs(...)%3A%20describe%20your%20change...\n-->"
|
||
} |