官网文档说的足够用了
An injectable service for executing work inside or outside of the Angular zone.
The most common use of this service is to optimize performance when starting a work consisting of one or more asynchronous tasks that don’t require UI updates or error handling to be handled by Angular. Such tasks can be kicked off via runOutsideAngular and if needed, these tasks can reenter the Angular zone via run.
对于不需要更新UI的异步操作, 用来优化性能
import {Component, View, NgZone} from 'angular2/core'; |
http://plnkr.co/edit/lY9m8HLy7z06vDoUaSN2?p=preview
这个runOutsideAngular
/** |
不做 change-detection 和 ChangeDetectionStrategy 里的detached 效果一样,但detached还是在zone里
/** |