How to use the angular-in-memory-web-api.getStatusText 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 xmlking / ngx-starter-kit / apps / webapp / src / app / in-memory-data.service.ts View on Github external
private finishOptions(options: ResponseOptions, { headers, url }: RequestInfo) {
    options.statusText = getStatusText(options.status);
    options.headers = headers;
    options.url = url;
    return options;
  }
}
github IgniteUI / igniteui-angular-samples / src / app / grid / services / mock-data.service.ts View on Github external
let top;
            skip = reqInfo.query.get("$skip");
            top = reqInfo.query.get("$top");
            if (skip && skip.length && skip.length === 1) {
                skip = parseInt(skip[0], 10);
            }
            if (top && top.length && top.length === 1) {
                top = parseInt(top[0], 10);
            }
            const data = { value: records.slice(skip, skip + top), count: records.length };

            const options: ResponseOptions = {
                body: data,
                status: STATUS.OK
            };
            options.statusText = getStatusText(options.status);
            options.headers = reqInfo.headers;
            options.url = reqInfo.url;
            return options;
        });
    }