title: Angular 1.x with TypeScript 2.x, @types, and SystemJS - Using global typings
body: <p>I am trying to use Angular 1.x with the new TS2 and @types registry but running into problems. It looks like @types does not use what the typings registry refered to as "global" typings. I am running into the following error:</p>
  
  <pre><code>error TS2686: 'angular' refers to a UMD global, but the current file is a module. Consider adding an import instead.
  </code></pre>
  
  <p>The angular code is as following:</p>
  
  <pre><code>import "angular";
  import "angular-route";
  
  const app = angular.module("charter-app", ["ui.bootstrap", "ui.router", "templates", "charter-app.controllers"]);
  </code></pre>
  
  <p>tsconfig.json:</p>
  
  <pre><code>{
      "compilerOptions": {
      "declaration": false,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "mapRoot": "./",
      "module": "system",
      "moduleResolution": "node",
      "sourceMap": true,
      "target": "es5",
      "inlineSources": true,
      "removeComments": false,
      "noImplicitAny": false,
      "typeRoots": [ "node_modules/@types/" ],
      "types": [ "angular", "angular-ui-bootstrap", "angular-ui-router" ],
      "outFile": "app.js"
      }
   }
  </code></pre>
  
  <p>Trying to use the following</p>
  
  <pre><code>"devDependencies": {
      "@types/angular": "^1.5.20",
      "@types/angular-ui-bootstrap": "^0.13.35",
      "@types/angular-ui-router": "^1.1.34",
  </code></pre>
  
  <p>I'm using gulp-typescript to do the compilation. What am I missing? Can I not use the @types libraries for this purpose?</p>