Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderToString: function(callback, options) {
try {
var component = findAngularComponent(options);
var serverBindings = [
ngRouter.ROUTER_BINDINGS,
ngUniversal.HTTP_PROVIDERS,
ngCore.provide(ngUniversal.BASE_URL, { useValue: options.requestUrl }),
ngCore.provide(ngRouter.APP_BASE_HREF, { useValue: '/' }),
ngUniversal.SERVER_LOCATION_PROVIDERS
];
return ngUniversalRender.renderToString(component, serverBindings).then(
function(successValue) { callback(null, successValue); },
function(errorValue) { callback(errorValue); }
);
} catch (synchronousException) {
callback(synchronousException);
}
}
};