You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 15:52:39