Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Fixes #54 [README] Code blocks that represent TypeScript fragments should be annotated as TypeScript code blocks #55

Merged
merged 1 commit into from
Oct 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ At minimum it must implement `createDb` which
creates a "database" hash whose keys are collection names
and whose values are arrays of collection objects to return or update.
For example:
```
```ts
import { InMemoryDbService } from 'angular-in-memory-web-api';

export class InMemHeroService implements InMemoryDbService {
Expand All @@ -57,7 +57,7 @@ export class InMemHeroService implements InMemoryDbService {

Register this module and your service implementation in `AppModule.imports`
calling the `forRoot` static method with this service class and optional configuration object:
```
```ts
// other imports
import { HttpModule } from '@angular/http';
import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
Expand All @@ -82,7 +82,7 @@ See examples in the Angular.io such as the
Some features are not readily apparent in the basic usage example.

The `InMemoryBackendConfigArgs` defines a set of options. Add them as the second `forRoot` argument:
```
```ts
InMemoryWebApiModule.forRoot(InMemHeroService, { delay: 500 }),
```

Expand Down Expand Up @@ -141,15 +141,15 @@ derived from the [HTTP Client](https://angular.io/docs/ts/latest/guide/server-co
sample in the Angular documentation.

Add the following line to `AppModule.imports`
```
```ts
InMemoryWebApiModule.forRoot(HeroDataService)
```

That file also has a `HeroDataOverrideService` derived class that demonstrates overriding
the `parseUrl` method and an HTTP GET interceptor.

Add the following line to `AppModule.imports` to see it in action:
```
```ts
InMemoryWebApiModule.forRoot(HeroDataOverrideService)
```

Expand Down Expand Up @@ -199,4 +199,4 @@ compiling your application project.
- 'latest'

[travis-badge]: https://travis-ci.org/angular/in-memory-web-api.svg?branch=master
[travis-badge-url]: https://travis-ci.org/angular/in-memory-web-api
[travis-badge-url]: https://travis-ci.org/angular/in-memory-web-api