【问题标题】:Error Angular Uncaught TypeError: Cannot read property 'bind' of undefined at bootstrap错误 Angular Uncaught TypeError:无法在引导时读取未定义的属性“绑定”
【发布时间】:2020-12-17 10:24:32
【问题描述】:

enter image description here

在执行 ng serve 运行我的项目时出现此错误

【问题讨论】:

    标签: angular


    【解决方案1】:

    如果您使用的是ng-bootstrap,请卸载并重新安装

    npm uninstall @ng-bootstrap/ng-bootstrap --save
    

    然后

    npm install @ng-bootstrap/ng-bootstrap --save
    

    另外,请确保您导入了

    import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
    

    在主题 Module.ts 文件中(可能是app.Module.ts

    以及导入数组中提到的

      imports: [
        ...
        NgbModule,
        ...
      ],
    

    但是,如果您使用的是传统引导程序,请确保您确实将相关的 @import 语句放在了 styles.css 文件中 示例

    @import "~bootstrap/dist/css/bootstrap.css";
    

    【讨论】:

      【解决方案2】:

      再次尝试npm install bootstrap。可能在npm 安装过程中出现了问题

      【讨论】:

        猜你喜欢
        • 2021-06-10
        • 2020-01-12
        • 1970-01-01
        • 1970-01-01
        • 2021-04-28
        • 2017-07-20
        • 1970-01-01
        • 2020-03-28
        • 2023-04-11
        相关资源
        最近更新 更多