为什么Bootstrap无法与Angular一起使用

问题描述

我安装了引导程序和jquary。我在angular.json中添加了js和css路径。我退出并再次运行服务器,但仍然无法启动。您能帮我解决这个问题吗?

这是表单和一些按钮,但引导程序不起作用。

enter image description here

我发现运行服务器时缺少styles.js。我不确定是否是问题!?而且我不知道如何解决

这是我运行Angular服务器的时间:

__msg_error

angular.json:

chunk {main} main.js,main.js.map (main) 18.8 kB [initial] [rendered]
chunk {polyfills} polyfills.js,polyfills.js.map (polyfills) 141 kB [initial] [rendered]
chunk {runtime} runtime.js,runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js,styles.js.map (styles) 12.5 kB [initial] [rendered]
chunk {vendor} vendor.js,vendor.js.map (vendor) 2.62 MB [initial] [rendered]
Date: 2020-09-14T08:40:22.944Z - Hash: ca7f2c17673277a29876 - Time: 5631ms
** Angular Live Development Server is listening on localhost:4200,open your browser on http://localhost:4200/ **
: Compiled successfully.

解决方法

我想问题是您已经提出:

      "styles": [
          "node_modules/bootstrap/dist/css/bootstrap.min.css","src/styles.css"
          
        ],"scripts": [
          
          "node_modules/jquery/dist/jquery.min.js","node_modules/bootstrap/dist/js/bootstrap.min.js"
        ]

"test"项目下,您应该将其放在"build"选项中。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...