要解决“Angular Material - DropListRef没有提供程序”的问题,您可以按照以下步骤操作:
npm install @angular/material @angular/cdk
DragDropModule
:import { DragDropModule } from '@angular/cdk/drag-drop';
@NgModule({
imports: [
// other imports
DragDropModule
],
// other module configurations
})
export class YourModule { }
MatList
),请确保您也正确地导入了相关模块。例如:import { MatListModule } from '@angular/material/list';
@NgModule({
imports: [
// other imports
MatListModule
],
// other module configurations
})
export class YourModule { }
DragDrop
服务。例如:import { DragDrop } from '@angular/cdk/drag-drop';
@Component({
// component configurations
})
export class YourComponent {
constructor(private dragDrop: DragDrop) { }
// component logic
}
通过这些步骤,您应该能够解决“Angular Material - DropListRef没有提供程序”的问题,并且能够正常使用相关的Angular Material拖放功能。