当我需要进入CommentListComment
时,它向我显示此错误:
组件CommentListComponent不属于任何NgModule或模块尚未导入到模块中。
这是我的代码:
@NgModule({
declarations: [CommentListComponent, CourseCommentComponent, CommentAddComponent, CommentEditComponent, CommentFiltersComponent, CommentReplyComponent],
imports: [
CommonModule,
// routing module imported here
LessonCommentRoutingModule,
CommonModule,
CoreModule,
ReactiveFormsModule,
FormsModule,
PartialsModule,
TranslateModule.forChild(),
Angular2PromiseButtonModule.forRoot(promiseButtonConfig),
SharedModule
],
exports:[CommentListComponent, CourseCommentComponent, CommentAddComponent, CommentEditComponent, CommentFiltersComponent, CommentReplyComponent]
})
这是我的LessonCommentRoutingModule:
{
path: '', component: CommentListComponent
, data: {
permission: {
permittedRoles: [':CourseLessonComment:GetAllManager'],
deniedRoles: null
} as AuthGuardPermission,
breadcrumb: 'Course Comments'
}
},
{
path: 'list',
component: CommentListComponent,
data: {
permission: {
permittedRoles: [':CourseLessonComment:GetAllManager'],
deniedRoles: null
} as AuthGuardPermission,
breadcrumb: 'List',
},
canActivate: [AuthGuard]
},
{
path: 'list/:lessonId',
component: CommentListComponent,
data: {
permission: {
permittedRoles: [':CourseLessonComment:GetAllManager'],
deniedRoles: null
} as AuthGuardPermission,
breadcrumb: 'List',
},
canActivate: [AuthGuard]
},
出了什么问题?我该如何解决????
编辑:
@Component({
selector: 'kt-comment-list',
templateUrl: './comment-list.component.html',
styleUrls: ['./comment-list.component.scss']
})
export class CommentListComponent implements OnInit, OnDestroy, AfterViewInit {
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
dataSource: CommentDataSource;
.............