27 lines
992 B
Markdown
27 lines
992 B
Markdown
|
@name Missing Reference Target
|
|||
|
@category compiler
|
|||
|
@shortDescription No directive found with export
|
|||
|
|
|||
|
@description
|
|||
|
Angular can’t find a directive with `{{ PLACEHOLDER }}` export name. This is common with a missing import or a missing [`exportAs`](https://angular.io/api/core/Directive#exportAs) on a directive.
|
|||
|
|
|||
|
@debugging
|
|||
|
Use the string name of the export not found to trace the templates or modules using this export.
|
|||
|
|
|||
|
Ensure that all dependencies are properly imported and declared in our Modules. For example, if the export not found is `ngForm`, we will need to import `FormsModule` and declare it in our list of imports in `*.module.ts` to resolve the missing export error.
|
|||
|
|
|||
|
```typescript
|
|||
|
import { FormsModule } from '@angular/forms';
|
|||
|
|
|||
|
@NgModule({
|
|||
|
...
|
|||
|
imports: [
|
|||
|
FormsModule,
|
|||
|
…
|
|||
|
```
|
|||
|
|
|||
|
If you recently added an import, you will need to restart your server to see these changes.
|
|||
|
|
|||
|
This is a duplicate issue of a [NG0301: Export Not Found](https://angular.io/errors/NG0301).
|
|||
|
|