[英]Error Angular Uncaught TypeError: Cannot read property 'bind' of undefined at bootstrap
enter image description here在此处输入图像描述
when doing ng serve to run my project I am getting this error当做 ng serve 运行我的项目时,我收到了这个错误
If you are using ng-bootstrap
then uninstall and install it again如果您使用的是
ng-bootstrap
,请卸载并重新安装
npm uninstall @ng-bootstrap/ng-bootstrap --save
then然后
npm install @ng-bootstrap/ng-bootstrap --save
also, be sure that you imported the另外,请确保您导入了
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
in the subject Module.ts file (probably app.Module.ts
)在主题Module.ts文件中(可能是
app.Module.ts
)
as well as mentioned in the imports array以及导入数组中提到的
imports: [
...
NgbModule,
...
],
However, if you are using the traditional bootstrap be sure you did put the related @import
statement in styles.css
file Example但是,如果您使用的是传统引导程序,请确保您确实将相关的
@import
语句放入styles.css
文件示例
@import "~bootstrap/dist/css/bootstrap.css";
Trying doing an npm install bootstrap
again.尝试再次执行
npm install bootstrap
。 Maybe there was an issue that occurred during the npm
installation可能在
npm
安装过程中出现问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.