Angular Intellisense was unable to determine accur

2019-09-08 19:14发布

问题:

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