Skip to content

Instantly share code, notes, and snippets.

@JiaLiPassion
Created July 10, 2018 08:11
Show Gist options
  • Save JiaLiPassion/9b0efdc9f97b590c72c1eee8a73fe7da to your computer and use it in GitHub Desktop.
Save JiaLiPassion/9b0efdc9f97b590c72c1eee8a73fe7da to your computer and use it in GitHub Desktop.
var zoneA = Zone.current.fork({name: 'zoneA'});
function callback() {
console.log('callback is invoked in context', Zone.current.name);
}
zoneA.run(function() {
console.log('I am in context', Zone.current.name);
setTimeout(zoneA.wrap(callback), 100);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment