我使用以下步骤将bootstrap包含到我的Angular项目中
-
用cli创建了角度项目
-
npm install bootstrap @ 3 jquery --save
-
然后像往常一样为我的索引文件添加了脚本和样式路径
风格并不隐含在我的页面上 . 我还有什么需要做的 . 我正在添加我的索引页面的html代码片段
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Project</title>
<script src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap-theme.min.css">
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>ewreeew</h1>
<button class="btn btn-primary">Test Button</button>
<app-root></app-root>
</body>
</html>
版本详细信息为:Angular CLI:6.0.8
节点:8.11.2
操作系统:win32 x64
角度:6.0.5
...动画,常见,编译器,编译器 - cli,核心,表单
... http,语言服务,平台浏览器
...平台浏览器动态,路由器
包版本
@ angular-devkit / architect 0.6.8
@ angular-devkit / build-angular 0.6.8
@ angular-devkit / build-optimizer 0.6.8
@ angular-devkit / core 0.6.8
@ angular-devkit / schematics 0.6.8
@ angular / cli 6.0.8
@ ngtools / webpack 6.0.8
@ schematics / angular 0.6.8
@ schematics / update 0.6.8
rxjs 6.2.1
打字稿2.7.2
webpack 4.8.3
谢谢