Topic: BsDropdownDirective StaticInjectorError
bfk.portal pro asked 5 years ago
Hello,
I tried to start up my Angular Applikation which worked 5 days ago but now I get an staticInjectorError with the BsDropdownDirective although i didn't even touch it. I have a dropdown in my navbar
<a dropdownToggle type="button" class="nav-link dropdown-toggle waves-light text-white" mdbWavesEffect><br> {{getDropdownName()}}<br> </a><br> <div class="dropdown-menu dropdown-primary dropdown-menu-right" role="menu"><br> <a class="dropdown-item" href="#" (click)="onLogout()">Abmelden</a><br> </div>
Like this but it always worked. I dont know from where the error is coming all of the sudden. I even tried to update everything but no success.This is the error
Best Regards
Matthias Herzog
Edit: As of now it seems to work if I write DropdownModule.forRoot()
the same goes for some other Modules too. But I don't get it why because it worked before without forRoot()?
Damian Gemza staff answered 5 years ago
Dear bfk.portal,
With the 7.4.0 we have changed the compilation tool of our library.
With the compilator change, we have resolved problems with the Three-Shaking of our library.
The DropdownModule
requires .forRoot()
method because there are some classes, which should be used globally.
Best Regards,
Damian
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: 7.0.0
- Device: Desktop
- Browser: Chrome
- OS: Windows 10
- Provided sample code: Yes
- Provided link: No