我正在使用使用 Angular 2(使用 CLI 创建项目)并安装了 Bootstrap。然后将 Bootstrap 的 CSS 添加到 angular-cli.json 中,样式起作用。但是当我有一个带有下拉菜单的导航栏时,它无法打开。我认为这是由于缺少
这里附上 angular-cli.json 参考。
bootstrap.js
,因此将其添加到 angular-cli.json 的脚本部分中,它抱怨缺少 jQuery!! 然后添加了 jQuery。现在它开始工作了,但我不确定自己是否正确操作。这里附上 angular-cli.json 参考。
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.css"
],
"scripts": ["./js/jquery.js", "../node_modules/bootstrap/dist/js/bootstrap.js"],