【发布时间】:2018-07-03 23:19:13
【问题描述】:
我想展示一个引导模式,但我还是得到了
SectionDetailComponent.html:54 ERROR TypeError: $(...).modal is not a function
我的 .angular-cli:
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
],
我的组件:
declare var jquery:any;
declare var $:any;
【问题讨论】:
-
你应该尝试使用 ngx-bootstrap 或
ng-bootstrap而不是使用常规 bootstrap.js 来使用 bootstrap 4 .ng-bootstrap.github.io/#/home 。它专为 Angular 4 设计 -
感谢您的回答,我真正的问题是 Popper.js,我只需要在 jquery 之后和引导之前添加内部脚本
-
Angular 版本的 Bootstrap(ng-bootstrap 或 ngx-bootstrap)比 Bootstrap + jQuery 与 Angular 一起工作得更好、更自然。注意:我没有在这里投反对票。
标签: jquery angular typescript bootstrap-4