angular中使用bootstrap问题

来源:2-5 开发准备

ithresh

2017-04-21

在 .angular-cli.json中配置如下:

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

这种配置就可以识别到 bootstrap 的css样式

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

这个样子配置的就不可以!

希望老师帮忙解惑下!

写回答

3回答

CUIT_IGIS

2017-05-30

这个不管目录是什么名字,因为在编译阶段是会寻找目录然后合并打包代码的,如果找不到依赖文件必然编译报错,但是为毛就是不不出现预期效果呢,bootstrap根本就没有引用上

0
0

qq_上帝吻的孩子_03295553

2017-05-03

同楼上,遇到一样的问题,求老师解释

0
0

JoJo

2017-04-24

node_modules里bootstrap的目录是什么名字?

0
3
用户164339
我目前找到的解决方法是用npm替换cnpm重新下载一遍bootstrap才可以,是因为cnpm下载的都是引用文件的问题吗,但是为什么jquery不会有问题呢?
2017-05-03
共3条回复

Angular4.0从入门到实战 打造股票管理网站

Angular新特性,教你熟练使用 Angular 和 Typescript 开发组件式单页应用

2683 学习 · 1361 问题

查看课程