title: TypeScript: Cannot find namespace 'ng'
body: <p>I'm trying to use a tsconfig.json so I can avoid having  at the top of a bunch of files. But I keep getting this error:</p>
  
  <blockquote>
    <p>[ts] Cannot find namespace 'ng'. any</p>
  </blockquote>
  
  <p>My <code>tsconfig.json</code> file looks like this:</p>
  
  <pre><code>{
      "compileOnSave": true,
      "compilerOptions": {
          "noImplicitAny": false,
          "target": "es2015",
          "allowSyntheticDefaultImports": true
      },
      "files": [
          "./typings/index.d.ts"
      ]
  }
  </code></pre>
  
  <p>As you can see, I'm pointing it to my <code>index.d.ts</code> file, which looks like this:</p>
  
  <pre><code>/// &lt;reference path="globals/angular-ui-router/index.d.ts" /&gt;
  /// &lt;reference path="globals/angular/index.d.ts" /&gt;
  /// &lt;reference path="globals/jquery/index.d.ts" /&gt;
  </code></pre>
  
  <p>However, if I put this reference at the top of my module:</p>
  
  <p><strong>app.controller.js</strong></p>
  
  <pre><code>/// &lt;reference path="../../../../typings/index.d.ts" /&gt;
  
  ...
  </code></pre>
  
  <p>it recognises <code>ng</code> and gives me its types. Any reason why this might not be working?</p>
  
  <p>Any help is appreciated. Thanks in advance!</p>