From 41d1c14770a6e4590d87d052cf29451f8e65c9cd Mon Sep 17 00:00:00 2001 From: Andrei Tserakhau Date: Tue, 10 May 2016 14:51:59 +0300 Subject: [PATCH] bug(ng2-template): fix issue with not disposed boot object --- templates/Angular2Spa/ClientApp/boot-server.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/Angular2Spa/ClientApp/boot-server.ts b/templates/Angular2Spa/ClientApp/boot-server.ts index d27d286d09..752337f005 100644 --- a/templates/Angular2Spa/ClientApp/boot-server.ts +++ b/templates/Angular2Spa/ClientApp/boot-server.ts @@ -15,7 +15,7 @@ export default function (params: any): Promise<{ html: string, globals?: any }> ...ngUniversal.NODE_HTTP_PROVIDERS, ]; - return ngUniversal.bootloader({ + let bootloader = ngUniversal.bootloader({ directives: [App], componentProviders: serverBindings, async: true, @@ -23,7 +23,10 @@ export default function (params: any): Promise<{ html: string, globals?: any }> // TODO: Render just the component instead of wrapping it inside an extra HTML document // Waiting on https://github.com/angular/universal/issues/347 template: '\n' - }).serializeApplication().then(html => { + }); + + return bootloader.serializeApplication().then(html => { + bootloader.dispose(); return { html }; }); }