Angular 角度cdk拖放在延迟加载中不起作用
在angular 7上发布时,我切换到了延迟加载功能,在此之前,cdk拖放功能曾经工作过,现在已经坏了 我在代码中使用了一些共享模块来集中模块,因此,例如,每当我需要模块A、B、C时,我只导入模块D,模块D本身会导入这些提到的模块 我尝试导入位于@angular/cdk/drag drop中的DragDropModule 在其中一个共享模块中,它不起作用 我还仔细检查了这些模块是否在任何地方都导入 请注意,我确保共享模块也已导出 共享模块Angular 角度cdk拖放在延迟加载中不起作用,angular,typescript,lazy-loading,angular-cdk,angular-dragdrop,Angular,Typescript,Lazy Loading,Angular Cdk,Angular Dragdrop,在angular 7上发布时,我切换到了延迟加载功能,在此之前,cdk拖放功能曾经工作过,现在已经坏了 我在代码中使用了一些共享模块来集中模块,因此,例如,每当我需要模块A、B、C时,我只导入模块D,模块D本身会导入这些提到的模块 我尝试导入位于@angular/cdk/drag drop中的DragDropModule 在其中一个共享模块中,它不起作用 我还仔细检查了这些模块是否在任何地方都导入 请注意,我确保共享模块也已导出 共享模块 import { NgModule } from '@a
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {DragDropModule} from '@angular/cdk/drag-drop';
@NgModule({
declarations: [],
imports: [DragDropModule, CommonModule],
exports : [DragDropModule]
})
export class DragDropSharedModule {}
在其他共享模具内
import {DragDropSharedModule} from './core-shared/drag-drop.module'
@NgModule({
declarations: [
NavbarComponent,
AppComponent,
// TimeAgoPipe,
RmSetTextComponent,
// ToggleComponent,
KeysPipe,
TimeAgoPipe
// LoadingComponent
////////////// AclControlComponent,
///////////// AclGroupListComponent,
////////////////////// AclPermissionComponent,
///////////// SelectedItemsPipe
],
imports: [
// BrowserModule,
ReactiveFormsModule,
FormsModule,
Ng2FileInputModule.forRoot(),
Ng2ImgFallbackModule,
CommonModule,
HttpClientModule,
// DragDropModule,
ScrollingModule,
NotFountPageModule,
RmTableModule,
ToggleModule,
DragDropSharedModule
]
下面是我如何让它工作的
<ng-container *ngFor="let item of [1,2,3,4,5]">
<cargo cdkDrag (cdkDragEnded)="dragEnded($event)">hello</cargo>
</ng-container>
你好
以下是我如何让它工作的
<ng-container *ngFor="let item of [1,2,3,4,5]">
<cargo cdkDrag (cdkDragEnded)="dragEnded($event)">hello</cargo>
</ng-container>
你好
已解决
我没有在其中一个共享模块中导入拖放模块
我没有在其中一个共享模块中导入拖放模块谢谢你的回答,我让它工作了;我意识到我没有在我的共享模块中导入拖放模块,我的BAD谢谢你的回答,我让它工作了;我意识到我没有在我的共享模块中导入拖放模块,我的坏模块