angularangular-materialchips

NG8001: 'mat-chip-list' is not a known element - Angular 19


I created a Test Component to check if angular material 19.0.0 supports mat-chip-list.
test-chips.component.ts:

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

@Component({
  selector: 'app-test-chips',
  standalone: true,
  imports: [MatChipsModule],
  template: `
    <mat-chip-list aria-label="Fish selection">
      <mat-chip>One fish</mat-chip>
      <mat-chip>Two fish</mat-chip>
      <mat-chip color="primary" selected>Primary fish</mat-chip>
    </mat-chip-list>
  `
})
export class TestChipsComponent { }  

But it is returning error shown below:

[ERROR] NG8001: 'mat-chip-list' is not a known element.

My package.json:

{
  "name": "complexclaims",
  "version": "0.0.1",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^19.0.0",
    "@angular/cdk": "^19.0.0",
    "@angular/common": "^19.0.0",
    "@angular/compiler": "^19.0.0",
    "@angular/core": "^19.0.0",
    "@angular/forms": "^19.0.0",
    "@angular/material": "^19.0.0",
    "@angular/platform-browser": "^19.0.0",
    "@angular/platform-browser-dynamic": "^19.0.0",
    "@angular/router": "^19.0.0",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.15.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^19.0.0",
    "@angular/cli": "^19.0.0",
    "@angular/compiler-cli": "^19.0.0",
    "@types/jasmine": "~5.1.0",
    "jasmine-core": "~5.4.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "typescript": "~5.6.2"
  }
}

Is it a bug in angular material 19?


Solution

  • The element attribute has changed. Please update mat-chip-list to mat-chip-set.

    Mat Chips - Documentation
    <mat-chip-set aria-label="Fish selection">
      <mat-chip>One fish</mat-chip>
      <mat-chip>Two fish</mat-chip>
      <mat-chip>Three fish</mat-chip>
      <mat-chip disabled>Four fish</mat-chip>
    </mat-chip-set>
    

    Stackblitz Demo