This is my first time using Angular Material, I am having an issue with mat-icons.
my index.html has:
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
In my shared module, I have the icons imported:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
MatButtonModule,
MatCardModule,
MatIconModule,
MatMenuModule,
MatToolbarModule,
} from '@angular/material';
@NgModule({
imports: [
CommonModule,
MatButtonModule,
MatCardModule,
MatIconModule,
MatMenuModule,
MatToolbarModule
],
exports: [
MatButtonModule,
MatCardModule,
MatIconModule,
MatMenuModule,
MatToolbarModule
],
declarations: []
})
export class SharedModule { }
then I import the SharedModule into my LoginModule:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedModule } from '../../shared/shared.module';
import { LoginRoutingModule } from './login.routing.module';
import { LoginContainerComponent } from './login-container/login-container.component';
import { LoginViewComponent } from './login-view/login-view.component';
@NgModule({
imports: [
CommonModule,
LoginRoutingModule,
SharedModule
],
declarations: [
LoginContainerComponent,
LoginViewComponent
]
})
export class LoginModule { }
finally I go to use the mat-icon in the view:
<mat-card>
<mat-card-title-group>
<mat-card-title>
Welcome to Track-It
</mat-card-title>
<mat-card-subtitle>
In order to use all of Track-it's goodness, please login...
</mat-card-subtitle>
</mat-card-title-group>
<mat-card-content>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Maxime quod labore autem. Sunt expedita ullam quis in deserunt rem eum, quas culpa quo aut eius consequuntur magni. Voluptates, mollitia ullam.
</mat-card-content>
<mat-card-actions [align]="'end'">
<button mat-flat-button>
Login
<mat-icon svgIcon="done"></mat-icon>
</button>
</mat-card-actions>
</mat-card>
Hover with this I get the following error:
Error retrieving icon: Unable to find icon with the name ":done"
I am by no means new to Angular, but definately new to Angular Material, so not to sure what is happening here. What I have above should be working. Thoughts?
This is how you should use the mat-icon
component
<mat-icon>done</mat-icon>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With