angular.js 的智能感知在 javascript 文件中不起作用 [英] Intellisense for angular.js does not work in a javascript file

查看:31
本文介绍了angular.js 的智能感知在 javascript 文件中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是支持 Angular.js 智能感知的 Visual Studio 2013.当我在 HTML5 文件的脚本标记内创建 Angular.js 模块时,Intellisense 确实有效.但是,当我尝试在 javascript 文件中创建相同的模块时,我没有获得智能感知.我有点不明白为什么会这样.

I'm using Visual Studio 2013 which supports Intellisense for Angular.js. Intellisense does indeed work when I create an Angular.js module within a script tag in a HTML5 file. However, when I attempt to create the same module in a javascript file I get no Intellisense. I'm a bit baffled as to why this is the case.

在 HTML 文件中工作的智能感知:

空白 javascript 文件中没有智能感知:

我没有在 VS2013 中安装 Resharper.提前感谢您的时间和任何建议!

I do not have Resharper installed in VS2013. Thanks in advance for your time and any advice!

推荐答案

javascript 文件需要对 angular js 的引用,以便它知道您在说什么.它看起来像这样:

The javascript file needs a reference to angular js so it know what you're talking about. It looks like this:

/// <reference path="ScriptFile1.js" />

请参阅此处了解更多信息 http://msdn.microsoft.com/en-us/图书馆/vstudio/bb385682.aspx

See here for more info http://msdn.microsoft.com/en-us/library/vstudio/bb385682.aspx

这篇关于angular.js 的智能感知在 javascript 文件中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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