Adds css theme class given the color to the component host
(colorPalette: ThemePalette)
| 352 | |
| 353 | /** Adds css theme class given the color to the component host */ |
| 354 | private _setColor(colorPalette: ThemePalette) { |
| 355 | const classList = this._elementRef.nativeElement.classList; |
| 356 | classList.remove(`mat-badge-${this._color}`); |
| 357 | if (colorPalette) { |
| 358 | classList.add(`mat-badge-${colorPalette}`); |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | /** Clears any existing badges that might be left over from server-side rendering. */ |
| 363 | private _clearExistingBadges() { |