Md-chip-list is not a known element

Viewed 7060

I have been trying to insert some md-chip elements in my project. All I get is "md-chip-list is not a known element".

HTML:

<md-chip-list>
    <md-chip *ngFor="let dependency of externalDependencies" color="primary" class="chip">
        {{dependency.name}}
    </md-chip>
</md-chip-list>

I have imported MdChipsModule, as I have seen in other answers:

import { MdChipsModule } from '@angular/material';

The code works if I leave out the md-chip-list tag, but the format is not as expected. I am new to Angular Material, so I would really appreciate some help.

2 Answers

Add below code in module.

import {MatChipsModule} from '@angular/material/chips';

@NgModule({

... imports: [MatChipsModule] ... })

Related