Search code examples
angulartypescriptngx-admin

How add angular/material for ngx-admin


I'm working with ngx-admin and it is familiar with Nebular Theme. But I want to add angular/material for it. I used lazyloading for this project. I tried install material for this by npm i @angular-materials/ngx-admin command. but it not success. I have a component named profile.

profile.component.html

<mat-card>
    <mat-card-header>
        <mat-toolbar class="toolbar">
            <mat-card-title>Contact List</mat-card-title>
            <span class="toolbar-spacer"></span>
            <mat-icon (click)="addContact()">add</mat-icon>
        </mat-toolbar>
    </mat-card-header>
</mat-card>

profile.module.ts

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
MatDialogModule,
MatToolbarModule,
MatIconModule,
MatCardModule
} from '@angular/material';
import { ProfileComponent } from './profile.component';

@NgModule({
declarations: [ProfileComponent],
imports: [
    CommonModule,

    MatDialogModule,
    MatCardModule,
    MatIconModule,
    MatToolbarModule
]
})
export class ProfileModule {}

I want to integrate angular/material with this. Then what I should do for this.


Solution

  • Import this theme into your styles.css file. It will get you material theme

      @import "~@angular/material/prebuilt-themes/indigo-pink.css";