Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why was the global 'angular' variable removed from angularjs.TypeScript.DefinitelyTyped?

Upgrading from angularjs.TypeScript.DefinitelyTyped 2.1.6 to 3.1.2 removed accessibility of the static angular variable I was using for module declaration files.

The following now gets an error that the symbol angular cannot be properly resolved.

angular
    .module("someModule")....

Resharper provides an option to import the variable from an external module, but this does not work.

Was the exposure of a global angular variable in earlier versions an error? Was it not intended to be used in the way my project has used it?

like image 285
gravidThoughts Avatar asked Jan 22 '15 20:01

gravidThoughts


2 Answers

It's a bug with Resharper 9.0. The fix is scheduled for the 9.1 release. You can do one of two things to remedy it now:

  1. Disable Resharper by going to Tools->Options->Resharper-> Suspend. Note that you'll lose all Resharper features and you'll probably want to re-enable VS's Intellisense.
  2. Get the latest 9.1 EAP release if you're comfortable to pre-release versions.
like image 187
Justin Schwartzenberger Avatar answered Oct 22 '22 04:10

Justin Schwartzenberger


I still see it in there. I suppose it's because the new version of the file uses syntax that is new to TypeScript 1.4. Either upgrade your compiler or downgrade to an earlier version of the .d.ts file.

like image 29
basarat Avatar answered Oct 22 '22 04:10

basarat