Skip to content

Instantly share code, notes, and snippets.

@coderkan
Created May 11, 2020 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderkan/e20ed6945fcc1657e32a424f07b0d9d2 to your computer and use it in GitHub Desktop.
Save coderkan/e20ed6945fcc1657e32a424f07b0d9d2 to your computer and use it in GitHub Desktop.
if (url.match(/\/employes\/.*/) && method === "DELETE") {
const empId = this.getEmployeeId(url);
return of(new HttpResponse({ status: 200, body: empId })).pipe(
delay(500)
);
}
getEmployeeId(url: any) {
const urlValues = url.split("/");
return urlValues[urlValues.length - 1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment