Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/422.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
Javascript 没有jquery的Yeoman angular项目_Javascript_Angularjs_Yeoman - Fatal编程技术网

Javascript 没有jquery的Yeoman angular项目

Javascript 没有jquery的Yeoman angular项目,javascript,angularjs,yeoman,Javascript,Angularjs,Yeoman,我试图使用yeoman构建一个新的angular项目,但我注意到很多依赖项导入了jquery。Bootstrap强制jquery导入,尽管我只计划使用Bootstrap css,而且我将使用ng strap而不是基于jquery的Bootstrap.js。类似地,karma依赖似乎也需要jquery 关于使用yeoman创建一个带有boostrap css的angular项目和一个不需要导入jquery的测试框架,是否有任何提示或最佳实践?yeoman只为您的项目创建样板文件。 使用I expe

我试图使用yeoman构建一个新的angular项目,但我注意到很多依赖项导入了jquery。Bootstrap强制jquery导入,尽管我只计划使用Bootstrap css,而且我将使用ng strap而不是基于jquery的Bootstrap.js。类似地,karma依赖似乎也需要jquery


关于使用yeoman创建一个带有boostrap css的angular项目和一个不需要导入jquery的测试框架,是否有任何提示或最佳实践?

yeoman只为您的项目创建样板文件。 使用I expect生成样板文件后,可以使用bower安装/卸载或编辑bower.js自由编辑依赖项。 您还可以在index.html中编辑jquery的导入


但是为什么在项目中使用jquery会有问题呢?你不需要仅仅因为它存在就使用它,但是如果你的第三方框架依赖它,你仍然需要它。

好的,我想我的问题是鲍尔问题,而不是约曼问题。我有一个bower.json文件,其中包含依赖项:dependencies:{angular:1.2.6,bootstrap:~3.0.3},但当我运行grunt bower install时,它会自动注入到我的index.html和bootstrap.js中。是否有一个bower依赖项只会让它注入css而不是javascript?您只需自己将注入到index.html中,而不运行grunt bower安装,那么您就可以完全控制:-