简体   繁体   中英

Angular Material 14 - common-behaviors folder not found after updating

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) {}
}

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM