我在下面发布了我的代码。我正在使用角度 DragDropModule 并且由于某种原因[cdkDragFreeDragPosition]
无法正常工作。它给了我如下所示的错误。我将 DragDropModule 添加到我的 ngModule 中,如下所示。当我删除[cdkDragFreeDragPosition]
标签时,拖放工作正常,但一旦添加它就会给我如下所示的错误。[cdkDragStartDelay]="1000"
也给出了同样的错误。我不知道为什么会出现这个问题。试图在网上找到解决方案,但不能。任何帮助,将不胜感激。
<div class="example-boundary">
<div class="example-box"
cdkDragBoundary=".example-boundary"
cdkDrag
*ngFor="let table of tables"
id="{{table._id}}"
(cdkDragEnded)="dragEnd($event)"
[cdkDragDisabled]="false"
[cdkDragFreeDragPosition]="getTablePosition(table)"
(cdkDragMoved)="dragMoved($event, table)">{{table.username}}
</div>
import { ServerOrderComponent } from './server-order/server-order.component';
import {DragDropModule} from '@angular/cdk/drag-drop';
@NgModule({
imports: [
MDBBootstrapModule.forRoot(),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
BrowserModule,
ReactiveFormsModule,
HttpClientModule,
routing,
FormsModule,
NotifierModule.withConfig(customNotifierOptions),
HttpModule,
MatIconModule,
BrowserAnimationsModule,
MatSidenavModule,
MatCheckboxModule,
MatFormFieldModule,
MatTableModule,
MatSortModule,
MatDividerModule,
MatButtonToggleModule,
MatProgressSpinnerModule,
NgMultiSelectDropDownModule.forRoot(),
DragDropModule
],
entryComponents: [],
declarations: [
AppComponent,
ServerOrderComponent
],
providers: [
],
bootstrap: [AppComponent]
})
export class AppModule {
}