fix(platform-server): allow multiple instances of platformServer and platformDynamicServer

This commit is contained in:
Vikram Subramanian
2017-02-12 09:16:23 -08:00
committed by Igor Minar
parent 0e2fd9d91a
commit 17486fd696
6 changed files with 152 additions and 113 deletions

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ApplicationRef, NgModuleFactory, NgModuleRef, PlatformRef, Provider, Type, destroyPlatform} from '@angular/core';
import {ApplicationRef, NgModuleFactory, NgModuleRef, PlatformRef, Provider, Type} from '@angular/core';
import {filter} from 'rxjs/operator/filter';
import {first} from 'rxjs/operator/first';
import {toPromise} from 'rxjs/operator/toPromise';
@ -40,7 +40,7 @@ function _render<T>(
.call(first.call(filter.call(applicationRef.isStable, (isStable: boolean) => isStable)))
.then(() => {
const output = platform.injector.get(PlatformState).renderToString();
destroyPlatform();
platform.destroy();
return output;
});
});