title: How to use zone.js in Angular?
body: <p>I would like to use zone.js in my Angular project ( not just the runOutsideAngularZone function ).</p>
  
  <p>I tried to include it like this:</p>
  
  <pre><code>import { zone } from 'zone.js';
  </code></pre>
  
  <p>Unfortunately I get this error:</p>
  
  <pre><code>error TS2306: File 'C:/projects/MyApp/node_modules/zone.js/dist/zone.js.d.ts' is not a module.
  </code></pre>
  
  <p>Then I removed the <code>{ zone }</code> part:</p>
  
  <pre><code>import 'zone.js';
  </code></pre>
  
  <p>But now I get this error:</p>
  
  <pre><code>error TS2552: Cannot find name 'zone'. Did you mean 'Zone'?
  </code></pre>
  
  <p>My code is this:</p>
  
  <pre><code>    let myZoneSpec = {
          beforeTask: function () {
              console.log('Before task');
          },
          afterTask: function () {
              console.log('After task');
          }
      };
      let myZone = zone.fork(myZoneSpec);
      myZone.run(() =&gt; {console.log('Task');});
  </code></pre>
  
  <p>If I replace <code>żone</code> with <code>Zone</code>, I get this:</p>
  
  <pre><code>error TS2339: Property 'fork' does not exist on type 'ZoneType'.
  </code></pre>
  
  <p>How could I import and use zone.js from Angular?</p>