Angular Intellisense was unable to determine accurate completion

泪湿孤枕 提交于 2019-12-12 02:49:52

问题


I am using Visual Studio 2015 for my angularjs app.

Intellisense works well here

but when I created an app.js file and try to write code there, intellisense does not work.

what did I miss here? Add 1: This is the folder structure


回答1:


I love this post from Mads Kristensen to explain how this works. You can add a reference to each file, or use _references.js to create a global reference list. A quick way to reference in just that file is to drag the file you want to reference from the solution explorer into the text editor for the document you are referencing from. It will add a special comment to the top of the file and you're all set.

By the way... it works in the HTML because visual studio can infer the presence of angular from the script tags in the document.




回答2:


You need to add a reference to the angular.js library via an include in app.js



来源:https://stackoverflow.com/questions/32389645/angular-intellisense-was-unable-to-determine-accurate-completion

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