Topic: mdb-error is not a known element?

Mitch pro asked 5 years ago


      <div class="md-form md-outline form-lg">
    <input
      mdbInput
      type="text"
      id="title"
      class="form-control form-control-lg"
      mdbValidate
      mdbInputDirective
      maxLength="48"
      autocomplete="off"
      formControlName="title">

    <label for="title">
      <h5>Post Title</h5>
    </label>

    <mdb-error *ngIf="title.invalid && (title.dirty || title.touched)">Title is required (min 4 characters, max 32 characters)</mdb-error>
    <mdb-success *ngIf="title.valid && (title.dirty || title.touched)">Input valid</mdb-success>
  </div>

and error i get is

ERROR in : 'mdb-error' is not a known element: 1. If 'mdb-error' is an Angular component, then verify that it is part of this module.


Ankita Nasipuri free answered 5 years ago


Hi I am also facing the same issue on using mdb-error and mdb-success. ERROR in : 'mdb-error' is not a known element: 1. If 'mdb-error' is an Angular component, then verify that it is part of this module.

My package.json has the following dependencies installed :

"dependencies": {
"@angular/animations": "~7.2.0",
"@angular/cdk": "8.1.2",
"@angular/common": "8.2.0 ^8.0.0",
"@angular/compiler": "8.2.0",
"@angular/core": "^8.2.0",
"@angular/forms": "^8.2.0",
"@angular/material": "8.1.2",
"@angular/material-moment-adapter": "8.1.2",
"@angular/platform-browser": "^8.2.0",
"@angular/platform-browser-dynamic": "^8.2.0",
"@angular/router": "~7.2.0",
"@ng-bootstrap/ng-bootstrap": "^5.0.0",
"angular-bootstrap-md": "^8.1.1",
"angular-bootstrap-slider": "^0.1.29",
"bootstrap": "^4.3.1",
"core-js": "^2.5.4",
"mdbootstrap": "^4.8.8",
"rxjs": "^6.4.0",
"tslib": "^1.9.0",
"zone.js": "^0.10.1"

}, Or can you suggest me some alternative.


Arkadiusz Idzikowski staff commented 5 years ago

Please show us the content of your app.module file (or any other module - that depends on your app structure, maybe you are importing MDB modules somewhere else).

Make sure that you imported InputUtilitiesModule (contains mdb-error and mdb-success components) or MDBBootstrapModulesPro.forRoot() (contains all free and pro MDB modules).


Ankita Nasipuri free commented 5 years ago

I got my error ...I have not imported InputUtilitiesModule in my app.module.ts. Now works fine. Thanks !!!


Damian Gemza staff answered 5 years ago


Dear computer.contact,

Could you please show me your app.module.ts file?

And also please provide me with the full code of your input - .html, and .ts.

There's must be something wrong, because those components are available from default in the MDB Angular Free.

Best Regards, Damian


Mitch pro answered 5 years ago


7.4.1 because I had to go change all my mdbValidate to mdbValidation


Damian Gemza staff answered 5 years ago


Dear computer.contact,

Which version of MDB Angular you're using?

The mdb-error and mdb-success components were added in the MDB Angular 7.1.0. If you're using something older which 7.1.0, please update your project, and let me know.

Best Regards,

Damian



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

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.0.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No
Tags