angular2-platform-node
Advanced tools
Comparing version 2.0.10 to 2.0.11
@@ -157,4 +157,21 @@ "use strict"; | ||
function errorHandler(err, store, modRef, currentIndex, currentArray) { | ||
var document = store.get('DOCUMENT'); | ||
_store && _store.clear(); | ||
var document = ''; | ||
try { | ||
document = store.get('DOCUMENT'); | ||
if (typeof document !== 'string') { | ||
document = Zone.current.get('document'); | ||
} | ||
if (typeof document !== 'string') { | ||
document = Zone.current.get('DOCUMENT'); | ||
} | ||
var appRef = store.get('ApplicationRef'); | ||
if (appRef && appRef.ngOnDestroy) { | ||
appRef.ngOnDestroy(); | ||
} | ||
if (modRef && modRef.destroy) { | ||
modRef.destroy(); | ||
} | ||
_store && _store.clear(); | ||
} | ||
catch (e) { } | ||
return document; | ||
@@ -484,2 +501,5 @@ } | ||
config.time && console.timeEnd('id: ' + config.id + ' asyncPromiseSeries: '); | ||
if (cancelHandler()) { | ||
return errorHandler(null, store, modRef, null, null); | ||
} | ||
return val; | ||
@@ -623,2 +643,3 @@ }); | ||
{ provide: core_1.APP_ID, useValue: '%cmp%' }, | ||
{ provide: core_1.TestabilityRegistry, useValue: { registerApplication: function () { return null; } } } | ||
], | ||
@@ -625,0 +646,0 @@ exports: [common_1.CommonModule, core_1.ApplicationModule] |
@@ -49,3 +49,3 @@ { | ||
], | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"homepage": "https://github.com/angular/universal", | ||
@@ -52,0 +52,0 @@ "license": "MIT", |
147199
3559