Angular 14项目中使用ngx-vis导入组件/模块的报错求助
Angular 14独立组件导入VisTimelineDirective报错及排查记录
在Angular 14的独立组件中导入VisTimelineDirective时,触发以下报错:
Component imports must be standalone components,
directives, pipes, or must be NgModules.
经排查,问题根源是vis-timeline.directive.d.ts文件缺失Directive声明。
以下是后续尝试的操作及对应报错:
- 将
VisTimelineDirective导入模块时,报错:'VisTimelineDirective' does not appear to be an NgModule class
- 将
VisTimelineDirective添加至模块的declarations数组中时,报错:Cannot declare 'VisTimelineDirective' in an NgModule
as it's not a part of the current compilation. - 在独立组件中导入
VisModule时,报错:Component imports must be standalone components,
directives, pipes, or must be NgModules. - 在模块中导入
VisModule时,报错:'VisModule' does not appear to be an NgModule class.
内容的提问来源于stack exchange,提问作者dsl400
相关产品推荐
相关产品推荐

