Visual Studio 2013 AngularJS intellisense support

匿名 (未验证) 提交于 2019-12-03 02:43:01

问题:

I thought VS 2013 is supposed to have support for angularjs attribute intellisense? For some reason it's not working for me on the latest version of Microsoft Visual Studio Ultimate 2013 version 12.0.21005.1

Getting the following validation warning: Attribute 'ng-app' is not a valid attribute of element 'html'.
Attribute 'ng-view' is not a valid attribute of element 'div'.

Am i missing an xsd reference somewhere?

回答1:

I had the same problem and I did the following and it helped.

If you are using ReSharper, you can add an extension that will give you Intellisense, and won't raise a warning.

Top Menu in VS>Resharper>Extension Manager>Search AngularJS This will add angular js intellisense.

-------EDIT-------

Using Resharper 8.2.1



回答2:

I know this is old, but it was still happening for me. To fix it for VS 2013, follow these instructions:

1) Open the file C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Packages\schemas\html\commonHTML5Types.xsd

2) Find the area in the file that starts with this line: . Scroll down about 7 lines to find the corresponding closing tag:

3) Just above the closing tag, paste the following lines of code:

Save the file and reopen VS2013. This should fix the issue.



回答3:

I installed http://vswebessentials.com/

created a file called _reference.js with content

///  ///  /// 

I learned about it from The Story Behind _references.js



回答4:

If you are using ReSharper, try turning off ReSharper IntelliSense for HTML.

ReSharper > Options > IntelliSense > General > Limited ReSharper IntelliSense

Notes:

  • This does not provide AngularJS intellisense in ASP.NET files
  • You need to reopen HTML files in VS after the settings have been changed
  • Current version of ReSharper is 8.2


回答5:

You could also just run this from the package manager console in VS 2013: Install-Package AngularJS.Intellisense.



回答6:

Try to tick Text Editor\HTML\General\Auto list members in options.



回答7:

Visual Studio 2013 Update 4 removes the validation, however it does not include IntelliSense for AngularJS.

Support for custom elements, polymer-elements and attributes

We no longer validate unknown attributers for custom elements as there will be many custom made tags in different frameworks. So there will no longer be squiggles under the unknown elements.

Announcing new Web Features in Visual Studio 2013 Update 4 RC

Download Visual Studio 2013 Update 4.

Validation is only removed in the HTML editor, not the HTML (Web Forms) editor. This means that, by default, .html files will not have custom element validation, but .aspx pages will. If, like me, you don't think this makes sense, show your support by voting for custom elements in .aspx files.



回答8:

Running into the same problem. If you have ReSharper installed on VS 2013 like me, you can get the instellisense by installing the AngularJS plugin (provided by JetBrains).

Here's how to do it:

  1. VS2013 > ReSharper > Manage Extension.
  2. Search "AngularJS" using Nuget online, then click "Install".

The above should get you what you needed. In case you need image guide, here's the link - http://jeeshenlee.com/2014/07/12/how-to-get-angularjs-intellisense-support-on-resharper/



回答9:

I know this post is old and the question specifically refers to VS 2013, however if you're still running VS 2010 and want to apply puargs solution you can find the file at C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\schemas\html\html_5.xsd.

You'll want to add puargs' code within the section.

Mads Kristensen also discusses [applying this solution to VS 2012]1 and provides a link to an updated version of 2012's commonHTML5Types.xsd in Step 2.

Also note that both puargs and Mads listings are missing an attribute on ng-view that causes an "attribute name must be followed by an equal (=) sign" warning. The complete element is: vs:standalone="true"/>.



回答10:

I have not tried with vs2013, but could work. Working with vs2012. http://madskristensen.net/post/angularjs-intellisense-in-visual-studio-2012



回答11:

I just disabled resharper intellisense for HTML pages and got angular intellisense back on VS2013



回答12:

You can also get rid of warnings:

http://madskristensen.net/post/angularjs-intellisense-in-visual-studio-2012



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!