Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't bind to 'md-tooltip' since it isn't a known property of 'span', upgrading from angular material 2.0.0-beta.10 to angular material 2.0.0-beta.11

I have upgraded Angular Material from 2.0.0-beta.10 to 2.0.0-beta.11

As you may know, MaterialModule has been removed from this version. Now the problem is that I don't know how to import all the modules that was included in MaterialModule.

When I try to import the modules I need one by one, Chrome console gives me the errors like this: "Can't bind to 'md-tooltip' since it isn't a known property of 'span'", even though in app.module.ts I have imported MatTooltipModule.

Any ideas?

like image 788
bazera Avatar asked Sep 23 '17 13:09

bazera


1 Answers

So, just to be sure. In you app.module.ts you have imported Material Design modules like this:

import {
  MatSnackBarModule, MatSidenavModule, MatProgressBarModule, MatListModule, MatCheckboxModule,
  MatTooltipModule
} from '@angular/material';

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    MatSnackBarModule,
    MatSidenavModule,
    MatProgressBarModule,
    MatListModule,
    MatCheckboxModule,
    MatTooltipModule,
    ...
  ],
  providers: [
   ...
  ]

Ah, i guess you forgot to rename everything from md- to mat-! Therefore, md-sidenav becomes mat-sidenav, and md-tooltip becomes mat-tooltip, etc.

See the change notes

like image 180
Matthias Sommer Avatar answered Nov 05 '22 00:11

Matthias Sommer