编写 CoffeeScript 时如何为 AngularJS 启用 Webstorm 智能感知 [英] How do I enable Webstorm intellisense for AngularJS when writing CoffeeScript

查看:33
本文介绍了编写 CoffeeScript 时如何为 AngularJS 启用 Webstorm 智能感知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了 Webstorm 来识别和编译我的 coffeescript 文件.

I have setup Webstorm to recognise and compile my coffeescript files.

我已经安装了 AngularJS 插件,并且可以用普通的旧 javascript 成功编写我的控制器等.

I have installed the AngularJS plugin and can successfully write my controllers etc in plain old javascript.

当我尝试在 CoffeeScript 中编写与角度相关的代码时,却没有得到任何 IDE 支持:代码完成、智能感知等.

When I try to write my angular related code in CoffeeScript however I do not get any IDE support: code-completion, intellisense etc.

如下图所示,angular 变量本身无法识别,这表明一切都不顺利.

As a sign that all is not well, the angular variable itself is not recognised, as shown in the image below.

问题:如何在 CoffeeScript 文件中启用对 AngularJS 的支持?

Question: How do I enable support for AngularJS in CoffeeScript files?

谢谢

推荐答案

要解决特定问题 Unresolved variable or type angular 你需要确保 angular javascript 库已经Enabled(见下图).

To fix the specific problem Unresolved variable or type angular you need to make sure the angular javascript libraries have been Enabled (see image below).

您可以通过 WebStorm 设置执行此操作:

You do this via the WebStorm settings:

文件 -> 设置 -> Javascript -> 库

File -> Settings -> Javascript -> Libraries

这是相关的帮助部分:配置 JavaScript 库

这篇关于编写 CoffeeScript 时如何为 AngularJS 启用 Webstorm 智能感知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆