Zone.js


function main() {
  b1.addEventListener('click', bindSecondButton);
}

function bindSecondButton() {
  b2.addEventListener('click', asyncThrowError);
}

function asyncThrowError() {
  setTimeout(throwError, 1000);
}


function throwError() {
  throw new Error('aw shucks');
}

/*
 * Bootstrap the app
 */
zone.fork(Zone.longStackTraceZone).run(main);