要在Angular 7中渲染Bootstrap控件,你需要进行以下步骤:
npm install bootstrap jquery
angular.json文件中,将Bootstrap和jQuery添加到styles和scripts数组中。确保路径正确。"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"
]
import 'bootstrap';
这些步骤应该能够帮助你在Angular 7中正确渲染Bootstrap控件。请确保依赖项的版本与你的Angular版本兼容。