<p dir="auto">A typical use case is instead of letting angular framework takes over the whole app, only certain parts of the app uses angular. So it would be nice if angular is self-contained, or at least have a clear boundary when it interacts with global component like <code class="notranslate">location</code> and how to dis-entangle them. See here for a discussion in Angular 1 tracking <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="8164751" data-permission-text="Title is private" data-url="https://github.com/angular/angular.js/issues/1537" data-hovercard-type="issue" data-hovercard-url="/angular/angular.js/issues/1537/hovercard" href="https://github.com/angular/angular.js/issues/1537">angular/angular.js#1537</a></p>
<p dir="auto">as we are moving from <code class="notranslate">import ... from 'angular2/angular2'</code> to <code class="notranslate">import ... from 'angular2/core'</code> we are starting to hit typescript compiler errors like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[DiffingTSCompiler]: Typescript found the following errors:
  app/sample-38.spec.ts (8, 32): Property 'toBe' does not exist on type 'NgMatchers'.
  app/sample-38.spec.ts (13, 35): Property 'toBe' does not exist on type 'NgMatchers'.
  app/sample-38.spec.ts (14, 37): Property 'toBe' does not exist on type 'NgMatchers'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/CoreOperators.d.ts (21, 70): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/CoreOperators.d.ts (74, 31): Cannot find name 'PromiseConstructor'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/CoreOperators.d.ts (74, 54): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (63, 53): Cannot find name 'PromiseConstructor'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (63, 74): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (74, 38): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (97, 69): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (149, 30): Cannot find name 'PromiseConstructor'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (149, 53): Cannot find name 'Promise'.
  node_modules/angular2/src/core/change_detection/parser/locals.d.ts (3, 14): Cannot find name 'Map'.
  node_modules/angular2/src/core/change_detection/parser/locals.d.ts (4, 42): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (71, 32): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (73, 17): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (77, 184): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (82, 182): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (106, 37): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/proto_view_factory.d.ts (28, 146): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (52, 144): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (76, 79): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (77, 73): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (95, 31): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (98, 18): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (101, 24): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (104, 162): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (105, 160): Cannot find name 'Map'.
  node_modules/angular2/src/core/render/api.d.ts (289, 74): Cannot find name 'Map'.
  node_modules/angular2/src/core/zone/ng_zone.d.ts (2, 37): Cannot find name 'Zone'.
  node_modules/angular2/src/facade/collection.d.ts (1, 25): Cannot find name 'MapConstructor'.
  node_modules/angular2/src/facade/collection.d.ts (2, 25): Cannot find name 'SetConstructor'.
  node_modules/angular2/src/facade/collection.d.ts (4, 27): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (4, 39): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (7, 9): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (8, 30): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (11, 43): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (12, 27): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (14, 23): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (15, 25): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (90, 41): Cannot find name 'Set'.
  node_modules/angular2/src/facade/collection.d.ts (91, 22): Cannot find name 'Set'.
  node_modules/angular2/src/facade/collection.d.ts (92, 25): Cannot find name 'Set'.
  node_modules/angular2/src/facade/lang.d.ts (2, 22): Cannot find name 'BrowserNodeGlobal'.
  node_modules/angular2/src/facade/lang.d.ts (47, 59): Cannot find name 'Map'.
  node_modules/angular2/src/facade/promise.d.ts (1, 10): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (3, 14): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (8, 32): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (9, 38): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (10, 35): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (10, 93): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (11, 34): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (12, 32): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (12, 149): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (13, 43): Cannot find name 'Promise'.
  node_modules/angular2/src/platform/browser/browser_adapter.d.ts (72, 33): Cannot find name 'Map'.
  node_modules/angular2/src/platform/dom/dom_adapter.d.ts (84, 42): Cannot find name 'Map'.
  node_modules/angular2/src/testing/matchers.d.ts (1, 37): Cannot find namespace 'jasmine'."><pre class="notranslate"><code class="notranslate">[DiffingTSCompiler]: Typescript found the following errors:
  app/sample-38.spec.ts (8, 32): Property 'toBe' does not exist on type 'NgMatchers'.
  app/sample-38.spec.ts (13, 35): Property 'toBe' does not exist on type 'NgMatchers'.
  app/sample-38.spec.ts (14, 37): Property 'toBe' does not exist on type 'NgMatchers'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/CoreOperators.d.ts (21, 70): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/CoreOperators.d.ts (74, 31): Cannot find name 'PromiseConstructor'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/CoreOperators.d.ts (74, 54): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (63, 53): Cannot find name 'PromiseConstructor'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (63, 74): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (74, 38): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (97, 69): Cannot find name 'Promise'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (149, 30): Cannot find name 'PromiseConstructor'.
  node_modules/angular2/node_modules/@reactivex/rxjs/dist/cjs/Observable.d.ts (149, 53): Cannot find name 'Promise'.
  node_modules/angular2/src/core/change_detection/parser/locals.d.ts (3, 14): Cannot find name 'Map'.
  node_modules/angular2/src/core/change_detection/parser/locals.d.ts (4, 42): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (71, 32): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (73, 17): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (77, 184): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (82, 182): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/element_injector.d.ts (106, 37): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/proto_view_factory.d.ts (28, 146): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (52, 144): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (76, 79): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (77, 73): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (95, 31): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (98, 18): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (101, 24): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (104, 162): Cannot find name 'Map'.
  node_modules/angular2/src/core/linker/view.d.ts (105, 160): Cannot find name 'Map'.
  node_modules/angular2/src/core/render/api.d.ts (289, 74): Cannot find name 'Map'.
  node_modules/angular2/src/core/zone/ng_zone.d.ts (2, 37): Cannot find name 'Zone'.
  node_modules/angular2/src/facade/collection.d.ts (1, 25): Cannot find name 'MapConstructor'.
  node_modules/angular2/src/facade/collection.d.ts (2, 25): Cannot find name 'SetConstructor'.
  node_modules/angular2/src/facade/collection.d.ts (4, 27): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (4, 39): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (7, 9): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (8, 30): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (11, 43): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (12, 27): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (14, 23): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (15, 25): Cannot find name 'Map'.
  node_modules/angular2/src/facade/collection.d.ts (90, 41): Cannot find name 'Set'.
  node_modules/angular2/src/facade/collection.d.ts (91, 22): Cannot find name 'Set'.
  node_modules/angular2/src/facade/collection.d.ts (92, 25): Cannot find name 'Set'.
  node_modules/angular2/src/facade/lang.d.ts (2, 22): Cannot find name 'BrowserNodeGlobal'.
  node_modules/angular2/src/facade/lang.d.ts (47, 59): Cannot find name 'Map'.
  node_modules/angular2/src/facade/promise.d.ts (1, 10): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (3, 14): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (8, 32): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (9, 38): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (10, 35): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (10, 93): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (11, 34): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (12, 32): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (12, 149): Cannot find name 'Promise'.
  node_modules/angular2/src/facade/promise.d.ts (13, 43): Cannot find name 'Promise'.
  node_modules/angular2/src/platform/browser/browser_adapter.d.ts (72, 33): Cannot find name 'Map'.
  node_modules/angular2/src/platform/dom/dom_adapter.d.ts (84, 42): Cannot find name 'Map'.
  node_modules/angular2/src/testing/matchers.d.ts (1, 37): Cannot find namespace 'jasmine'.
</code></pre></div>
<p dir="auto">This is because when importing from <code class="notranslate">angular2/angular</code>, we are pulling in <code class="notranslate">angular2.d.ts</code> which pulls in <code class="notranslate">globals-es6.d.ts</code>. However when importing from <code class="notranslate">angular2/core</code> we no longer pull in the <code class="notranslate">globals-es6.d.ts</code> file, which results in all kinds of typings missing.</p>
<p dir="auto">To work around this, developers need to explicitly refer to this d.ts file via tripple-slash reference or via tsconfig.json. (example: <a href="https://github.com/angular/angular-cli/pull/85/files#r46653752">https://github.com/angular/angular-cli/pull/85/files#r46653752</a>).</p>
<p dir="auto">Note: <code class="notranslate">globals-es6.d.ts</code> is actually pretty problematic because it pulls in type definitions for not only es6 shims, but also jasmine, promises and bunch of other stuff. This is pretty messy and we should find a better way to do it, but that's a separate issue.</p>
<p dir="auto">// <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rkirov/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rkirov">@rkirov</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alexeagle/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alexeagle">@alexeagle</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mprobst/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mprobst">@mprobst</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cironunes/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cironunes">@cironunes</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/vsavkin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/vsavkin">@vsavkin</a></p>