()
| 219 | } |
| 220 | |
| 221 | ngAfterViewInit() { |
| 222 | if (typeof ngDevMode === 'undefined' || ngDevMode) { |
| 223 | const nativeElement = this._elementRef.nativeElement; |
| 224 | |
| 225 | // Heads-up for developers to avoid putting matBadge on <mat-icon> |
| 226 | // as it is aria-hidden by default docs mention this at: |
| 227 | // https://material.angular.dev/components/badge/overview#accessibility |
| 228 | if ( |
| 229 | nativeElement.tagName.toLowerCase() === 'mat-icon' && |
| 230 | nativeElement.getAttribute('aria-hidden') === 'true' |
| 231 | ) { |
| 232 | console.warn( |
| 233 | `Detected a matBadge on an "aria-hidden" "<mat-icon>". ` + |
| 234 | `Consider setting aria-hidden="false" in order to surface the information assistive technology.` + |
| 235 | `\n${nativeElement.outerHTML}`, |
| 236 | ); |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | ngOnDestroy() { |
| 242 | // ViewEngine only: when creating a badge through the Renderer, Angular remembers its index. |
nothing calls this directly
no test coverage detected