How to use the angular-in-memory-web-api.InMemoryBackendService function in angular-in-memory-web-api

To help you get started, we’ve selected a few angular-in-memory-web-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pschild / CodeRadarVisualization / src / app / XHRBackendFactory.ts View on Github external
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);
    }
}
github apache / ambari-logsearch / ambari-logsearch-web / src / app / test-config.spec.ts View on Github external
export function getTestXHRBackend(injector: Injector, browser: BrowserXhr, xsrf: XSRFStrategy, options: ResponseOptions) {
  return new InMemoryBackendService(
    injector,
    new MockApiDataService(),
    {
      passThruUnknownUrl: true,
      rootPath: ''
    }
  );
}