Update:
Starting with version 2.0.0-beta.11, the prefix md- completely and the prefix mat- should be moved forward.
If you are using a version lower than 2.0.0-beta.11, then it will only be if your project uses the AngularJS component next to Angular Material 2.
If you are not using the AngularJS file in your project, just use the md- prefix and you will not have compatibility issues (like CSS collisions).
Decision:
If your project uses AngularJS Material And Angular 2 Material, and you need to avoid CSS collisions:
Import NoConflictStyleCompatibilityMode into the root module of the application.
import { NoConflictStyleCompatibilityMode } from '@angular/material' @NgModule({ ..., imports: [NoConflictStyleCompatibilityMode] }) export class AppModule {}
Then use the md- prefix for md- material elements and the mat- prefix for Angular material elements 2.
The compatibility mode for @angular/material allows components (prefixed with md- ) to exist side by side with AngularJS Material components without any CSS collisions.
When this mode is turned on, the compatibility mode forces all template APIs to use the mat- prefix instead of md- . This will prevent CSS corruption from AngularJS material for components in @angular/material .
Documentation for found here .
source share