3

I faced to this error while engage with an angular project. I can not understand that what should I do. any one can help me?

SCRIPT5022: Template parse errors:
'mdb-navbar-brand' is not a known element:
1. If 'mdb-navbar-brand' is an Angular component, then verify that it is part of this module.
2. If 'mdb-navbar-brand' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
mruanova
  • 6,351
  • 6
  • 37
  • 55
ruwan liyanage
  • 419
  • 2
  • 11
  • 24
  • 1
    Possible duplicate of [Template parse errors: 'md-form-field' is not a known element](https://stackoverflow.com/questions/45954397/template-parse-errors-md-form-field-is-not-a-known-element) – Lakindu Akash Mar 01 '19 at 17:03
  • Use https://mdbootstrap.com/docs/angular/getting-started/quick-start/ to setup md bootstrap for Angular. – Pavindu Jun 24 '19 at 15:44

2 Answers2

7

you need to import the module first to use it in your component. So in your app component import it like below.

import { MDBBootstrapModule } from 'angular-bootstrap-md';

@NgModule({
    imports: [
        MDBBootstrapModule.forRoot()
    ]
});

Add scss to your angular.json configuration file if you are using angular cli

"node_modules/angular-bootstrap-md/scss/bootstrap/bootstrap.scss",
"node_modules/angular-bootstrap-md/scss/mdb-free.scss",

And now it should work with all style

Aniruddha Das
  • 20,520
  • 23
  • 96
  • 132
0

This is saying that you need to import your component in your module because otherwise the HTML tag mdb-navbar-brand is not found or recognized as anything.

import { MdbNavBar} from './mdb-nav-bar.component';
mruanova
  • 6,351
  • 6
  • 37
  • 55