Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function XHRBackendFactory(injector: Injector, browser: BrowserXhr, xsrf: XSRFStrategy, options: ResponseOptions) {
if (environment.demo) {
return new InMemoryBackendService(injector, new MockData(), {
// This is the configuration options
});
} else {
return new XHRBackend(browser, options, xsrf);
}
}
export function getTestXHRBackend(injector: Injector, browser: BrowserXhr, xsrf: XSRFStrategy, options: ResponseOptions) {
return new InMemoryBackendService(
injector,
new MockApiDataService(),
{
passThruUnknownUrl: true,
rootPath: ''
}
);
}