Home > Mobile >  Angular Material 14 - common-behaviors folder not found after updating
Angular Material 14 - common-behaviors folder not found after updating

Time:06-15

After updating to Angular 14, the following code snippet is not working anymore.

Looks like common-behaviors folder is not being found.

Is there any other solution than creating myself the HasElementRef interface?

import { HasElementRef } from '@angular/material/core/common-behaviors/color'

export class MyClass implements HasElementRef {
  constructor(public _elementRef: ElementRef) {}
}

CodePudding user response:

I'm not sure why you'd be using that interface to begin with - it's an internal interface from what I can see with just a single property

/** @docs-private */
export interface HasElementRef {
  _elementRef: ElementRef;
}

Copy it and use your version if needs be

  • Related