
p.location-badge.
  exported from <a href="/angular2/core.html">angular2/core</a>
  defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/zone/vm_turn_zone.js#L14">angular2/src/core/zone/vm_turn_zone.js (line 14)</a>

:markdown
  A wrapper around zones that lets you schedule tasks after it has executed a task.
  
  The wrapper maintains an "inner" and "outer" `Zone`. The application code will executes
  in the "inner" zone unless `runOutsideAngular` is explicitely called.
  
  A typical application will create a singleton `VmTurnZone` whose outer `Zone` is the root `Zone`
  and whose default `onTurnDone` runs the Angular digest.
  
.l-main-section
  h2 Members
  .l-sub-section
    h3 constructor

    
    pre.prettyprint
      code.
        constructor({enableLongStackTrace}, [object Object])
    
    :markdown
      Associates with this
      
      - an "outer" zone, which is the one that created this.
      - an "inner" zone, which is a child of the outer zone.
      




  .l-sub-section
    h3 initCallbacks

    
    pre.prettyprint
      code.
        initCallbacks({onTurnStart, onTurnDone, onScheduleMicrotask, onErrorHandler} = {}, [object Object], [object Object], [object Object], [object Object])
    
    :markdown

      Initializes the zone hooks.
      





  .l-sub-section
    h3 run

    
    pre.prettyprint
      code.
        run(fn)
    
    :markdown

      Runs `fn` in the inner zone and returns whatever it returns.
      
      In a typical app where the inner zone is the Angular zone, this allows one to make use of the
      Angular's auto digest mechanism.
      
      ```
      var zone: VmTurnZone = <ref to the application zone>;
      
      zone.run(() => {
        // auto-digest will run after this function is called from JS
      });
      ```





  .l-sub-section
    h3 runOutsideAngular

    
    pre.prettyprint
      code.
        runOutsideAngular(fn)
    
    :markdown

      Runs `fn` in the outer zone and returns whatever it returns.
      
      In a typical app where the inner zone is the Angular zone, this allows one to escape Angular's
      auto-digest mechanism.
      
      ```
      var zone: VmTurnZone = <ref to the application zone>;
      
      zone.runOusideAngular(() => {
        element.onClick(() => {
          // Clicking on the element would not trigger the change detection
        });
      });
      ```




