在WebStorm中使用Angular 4启用Bootstrap Intellisense [英] Enable Bootstrap Intellisense using Angular 4 in WebStorm
问题描述
我正在学习Angular 4,并且正在使用Bootstrap CSS.
I'm learning Angular 4 and I'm using Bootstrap CSS.
我已经使用npm安装了Bootstrap库,并使用 src
文件夹下的 style.css
文件将了Bootstrap导入了我的Angular项目中.
I've installed Bootstrap libraries using npm and I've imported Bootstrap in my Angular project using the style.css
file under the src
folder.
一切正常,但是WebStorm在编写代码时不建议我任何Bootstrap类,而且我不明白为什么.我需要设置一些东西吗?
Everything works well but WebStorm doesn't suggest me any Bootstrap classes while I'm coding and I can't understand why. Do I have to set something up?
如果我将Bootstrap链接到 index.html
文件中,则一切正常.
If I link Bootstrap inside my index.html
file everything works fine.
推荐答案
这似乎有些奇怪,但是我可以通过将整个bootstrap文件夹(zip)复制到index.html所在的同一目录中来工作.我也对font-awesome文件夹做了同样的事情.
This might seem kind of odd, but I got this able to work by copying the entire bootstrap folder(zip) into the same directory my index.html is in. I did the same with the font-awesome folder too.
为我找到工作!让我知道它是否有效.
Worked find for me! Let me know if it works.
刚刚向我展示了一种执行此操作的新方法.在webstorm中,右键单击一个文件夹,然后选择标记为资源根目录".那对我也有用.
I was just shown a new way to do this. In webstorm right click on a folder and select "Mark as resource root". That also worked for me.
这篇关于在WebStorm中使用Angular 4启用Bootstrap Intellisense的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!