Search code examples
cssangularjsangularangular-materialangularjs-material

How to run hybrid app AngularJS/Material1 with Angular/Material2


i currently have an AngularJS + angular materialv1 app, and we're migrating it to Angular + angular materialv2. We're running it in hybrid mode for now. All is working well except for the CSS styles.

Styles from material 1 and 2 are conflicting. I read that i need to use the "compatibility mode" : https://github.com/angular/material2/pull/2790

But I couldn't find out how to set it. Would anyone know how to turn it on ?

Thanks for your help on this.


Solution

  • I found the solution here: i need to import the NoConflictStyleCompatibilityMode class along with MaterialModule

    import { MaterialModule, NoConflictStyleCompatibilityMode  } from '@angular/material';
    ...
    @NgModule({
        imports: [
            MaterialModule,
            NoConflictStyleCompatibilityMode
        ],...
    

    If that can help someone...