mdb-badge not work


Topic: mdb-badge not work

allancmello pro asked 5 years ago

The component is not working in the PRO version in the Backend Firebase template. All steps to include ng-uikit-pro-standard were made, including the additions of BadgeModule and MDBBootstrapModulesPro in the app.modules and their imports. But it does not work!

Template parse errors: 'mdb-badge' is not a known element: 1. If 'mdb-badge' is an Angular component, then verify that it is part of this module. 2. If 'mdb-badge' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

import { MDBBootstrapModulesPro, ModalModule, BadgeModule } from 'ng-uikit-pro-standard';
....
BadgeModule,
ModalModule.forRoot(),
MDBBootstrapModulesPro.forRoot(),

main.component.html
<mdb-badge pill="true" color="purple">9</mdb-badge>

I performed the same procedures described here in a previous post, but it did not work.


Damian Gemza staff answered 5 years ago

Dear @allancmello

Are you sure, that you have followed closely our Quickstart Guide for MDB Angular Pro?

You have to install ng-uikit-pro-standard package, then import MDBBootstrapModulesPro.forRoot() in your app.module.ts, and then you're ready to use the Pro components.

Your error stack trace says, that the mdb-badge component is not a known element - it is not imported in your application.

Please remove the node_modules directory, and package-lock.json file, and perform one more time every step from the Quickstart Guide.

If your problem won't go, please let me know.

Best Regards,

Damian


allancmello pro commented 5 years ago

Hi Damian,

Yes, i did.

But according to MDBootstrap documentation, declaring the MDBootstrapModules.forRoot () in the app.modules (globally) should work, since this module contains all the functions. However, it was necessary to declare in all the modules that the application uses, this way it worked.

Thanks for the feedback, you can close this topic.


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.4
  • Device: Desktop
  • Browser: All
  • OS: Windows
  • Provided sample code: No
  • Provided link: No