Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 无法将引导添加到角度项目_Angular_Twitter Bootstrap_Bootstrap 4 - Fatal编程技术网

Angular 无法将引导添加到角度项目

Angular 无法将引导添加到角度项目,angular,twitter-bootstrap,bootstrap-4,Angular,Twitter Bootstrap,Bootstrap 4,我试图添加引导到我的角度项目,但我不能。我也没有收到任何错误 我甚至在stackoverflow上尝试了一些解决方案。我用的是Angular 7。我已经安装了bootstrap、jquery和popper.js。我还将它们添加到angular.json中 下面是我的angular.json "styles": [ "src/styles.css", "./node_modules/bootstrap/dist/css/bootstrap.m

我试图添加引导到我的角度项目,但我不能。我也没有收到任何错误

我甚至在stackoverflow上尝试了一些解决方案。我用的是Angular 7。我已经安装了bootstrap、jquery和popper.js。我还将它们添加到angular.json中

下面是我的angular.json

"styles": [
              "src/styles.css",
              "./node_modules/bootstrap/dist/css/bootstrap.min.css"
            ],
            "scripts": [ "./node_modules/jquery/dist/jquery.min.js",
              "../node_modules/popper.js/dist/umd/popper.min.js",
              "./node_modules/bootstrap/dist/js/bootstrap.min.js"],
以下是我在AppModule.ts中的导入语句

import { bootstrap } from 'bootstrap';
我还没有将其包含在导入数组中。因为当我这么做的时候,我犯了以下错误

Unexpected value 'undefined' imported by the module 'AppModule'

非常感谢您的帮助。

不需要在AppModule.ts文件中导入引导,您可以使用引导类而无需导入任何模块。因为您已经在angular.json文件中导入了引导css和js文件

"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js",
"./node_modules/popper.js/dist/umd/popper.min.js"
可能您在
popper.js
中超过了另一个点。
如果路径正确,请检查您的节点模块。

我猜您试图导入到AppModule中的一个NGModule没有定义。您是否“导出”了NgModule?另外,如果您编辑了angular.json,请尝试重新构建并运行