Topic: There is no directive with "exportAs" set to mdbModal

herve pro asked 4 years ago


Hello

I read the previous answers on the subject well but that does not solve my problem. I have the error on the definition of my modal:

here is what i have in app.module.ts:

@NgModule ({ statements: [ AppComponent, VieComponent, AbsComponent, LoginComponent, AbsComponentRequests, FilterRequestAbsPipe, FilterRequestPipe, FilterJeuViePipe, FilterSearchTextPipe, FilterActorPipe, ConcatIdLibJeu, ModalConfirm, LifeGameComponent, LifeRequestComponent, ParametersComponent, ParametersComponentGroup, ParametersActorComponent, ParametersComponentMessages, ParametersLimitsComponent, ErrorServerComponent ], imports: [ BrowserModule, BrowserAnimationsModule, HttpClientModule, ReactiveFormsModule, FormsModule, Ng2SearchPipeModule, NgxPaginationModule, OrderModule, MDBBootstrapModulesPro.forRoot (), ToastModule.forRoot (), RouterModule.forRoot (appRoutes, {useHash: true}) ], diagrams: [NO_ERRORS_SCHEMA], providers: [ {provide: "DomaineWebService", useClass: environment.domaineServiceType}, {provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true}, AuthenticationService, ApiService, FileUtil, MiscellaneousService, DataService, DatePipe ], entryComponents: [ ModalConfirm ], bootstrap: [AppComponent]

}) export class AppModule { }

Thank you for your help


Arkadiusz Idzikowski staff commented 4 years ago

Please add the html code you use to render MDB modal to your post.


herve pro commented 4 years ago

here is the html code :

<i class="fa fa-eye ml-2"  (click)="loadedId.show()"></i>

<div mdbModal #loadedId="mdbModal" class="modal fade" role="dialog" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
    <div class="modal-content">
            ...
    </div>
</div>

in my ts file I use this code to dynamiccaly show the modal :

@ViewChild('loadedId') public loadedId: ModalDirective;
    ...
this.loadedId.show();

Thank you


Arkadiusz Idzikowski staff commented 4 years ago

When is the loadedId.show() called in the component ts? Does this problem occur also when you try to open modal by clicking on the icon?

If you use lazy loading modules, you need to import MDB modules for specific components in every lazy loaded module. Because these modules will not have access to the imports of root module.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.4.0
  • Device: pc
  • Browser: chrome
  • OS: windows 7
  • Provided sample code: No
  • Provided link: No