-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stark-demo): integrate "angular-in-memory-web-api" to mock backe…
…nd (needed for GitHub pages)
- Loading branch information
1 parent
647b41c
commit f698865
Showing
16 changed files
with
433 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { NgModule } from "@angular/core"; | ||
import { HTTP_INTERCEPTORS } from "@angular/common/http"; | ||
// using the full path to import the "HttpClientInMemoryWebApiModule" to avoid adding "@angular/http" to Showcase npm dependencies! | ||
// see https://github.com/angular/in-memory-web-api/issues/215 | ||
import { HttpClientInMemoryWebApiModule } from "angular-in-memory-web-api/http-client-in-memory-web-api.module"; | ||
import { InMemoryDataService } from "./services"; | ||
import { InMemoryDataHttpInterceptor } from "./interceptors"; | ||
|
||
@NgModule({ | ||
imports: [ | ||
// advanced configuration for the HttpClientInMemoryWebApiModule (see https://github.com/angular/in-memory-web-api#advanced-features) | ||
// see all possible options in InMemoryBackendConfigArgs in node_modules/angular-in-memory-web-api/interfaces.d.ts | ||
HttpClientInMemoryWebApiModule.forRoot(InMemoryDataService, { | ||
delay: 100, | ||
apiBase: "/", | ||
passThruUnknownUrl: true | ||
}) | ||
], | ||
providers: [ | ||
// Add the InMemoryDataHttpInterceptor as an Http interceptor to adapt requests/responses according to the NBB Rest API Guide | ||
{ provide: HTTP_INTERCEPTORS, useClass: InMemoryDataHttpInterceptor, multi: true } | ||
] | ||
}) | ||
export class InMemoryDataModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./interceptors"; | ||
export * from "./services"; | ||
export * from "./in-memory-data.module"; |
Oops, something went wrong.