Topic: template/form driven mdb-select

vtaevere free asked 2 years ago


Expected behavior

I'm sorry about the low-quality question, but the example mdb-select does not work with either Reactive forms or Template driven forms.

When specifying input [(ngModel)] string to mdb-select:

1) Type 'Event' is not assignable to type 'string'.

switching the type of the ngModel string to 'string | Event':

Can't bind to 'ngModel' since it isn't a known property of 'mdb-select'.

Actual behavior

Compilation errors

Resources (screenshots, code snippets etc.)

https://mdbootstrap.com/docs/b5/angular/forms/select/#section-set-value


Grzegorz Bujański staff answered 2 years ago


You probably don't have FormModule imported.

import { FormsModule } from '@angular/forms';

@NgModule({
    imports: [
         FormsModule      
    ],
    ...
})


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: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: MDB5 1.5.1
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes