ERROR in Type FileSelectDirective is part of the declarations of 2 modules: #706
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I use "ng build - prod - aot" appeared a mistake:
ERROR in Type FileSelectDirective is part of the declarations of 2 modules:
FileUploadModule and SystemModule,Please consider moving FileSelectDirective
to a higher module that imports FileUploadModule and SystemModule
You can also create a new NgModule that exports and includes
FileSelectDirective then import that NgModule in FileUploadModule and SystemModule
The directive can be declared in just one Module.
create shared.module.ts
@NgModule({
declarations: [
FileSelectDirective,
FileDropDirective
],
imports: [
],
exports: [
FileSelectDirective,
FileDropDirective
]
})
export class SharedModule {
}
Add SharedModule to import list in both (FileUploadModule and SystemModule).
you need to import the FileUploadModule in the SystemModule instead of delcare the directives
// SystemModule.js
@NgModule({
declarations: [
... // remove directives
],
imports: [
... // add FileUploadModule here
FileUploadModule
]
@daton89
It throws following error :
@AnupKumarGupta can you show me your app.module.ts code?
@daton89 I just removed the directive from
declarations. I didn't add them toimportsIt worked.Thanks 👍
same issue here.
because in another project that I have, do the pages in statements and in components? Could you solve that question? Greetings, friend, your answer helped me a lot in another project. @daton89
@armando0594 i don't understand your question, please can you explain what are you asking me?
thanks