Getting Error - Cannot find name 'angular'

前端 未结 7 1552
野的像风
野的像风 2020-12-15 17:20

I\'m starting writing AngularJS app using TypeScript. I have this simple module command:

(() => {
    angular
        .module(\'app\', []);
})();
<         


        
7条回答
  •  [愿得一人]
    2020-12-15 17:42

    ATOM

    In tsconfig.json file ensure your "fileGlobs" points to both:-

    1. The TypeScript Definitions you installed with tsd &
    2. Your src .ts files
    "filesGlob": [
      "./typings/**/*.ts",
      "./src/client/**/*.ts"
    ]
    

    This will ensure you have tooling for the libraries you have installed (with tsd) without having to declare any variables. For example, if you tsd install angularjs --save, you can work angular in your src/../*.ts files with all the goody tooling.

    Hope this helps. Good Luck.

提交回复
热议问题