angular-in-memory-web-api
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -12,2 +12,12 @@ # "angular-in-memory-web-api" versions | ||
<a id="0.8.0"></a> | ||
## 0.8.0 (2018-12-06) | ||
* remove `@angular/http` support | ||
* no functional changes | ||
**BREAKING CHANGE** | ||
This version no longer supports any functionality for `@angular/http`. Please use | ||
`@angular/common/http` instead. | ||
<a id="0.7.0"></a> | ||
@@ -14,0 +24,0 @@ ## 0.7.0 (2018-10-31) |
@@ -8,7 +8,5 @@ ////// For apps with both Http and HttpClient //// | ||
}; | ||
import { Injector, NgModule } from '@angular/core'; | ||
import { XHRBackend } from '@angular/http'; | ||
import { NgModule } from '@angular/core'; | ||
import { HttpBackend, XhrFactory } from '@angular/common/http'; | ||
import { InMemoryBackendConfig, InMemoryDbService } from './interfaces'; | ||
import { httpInMemBackendServiceFactory } from './http-in-memory-web-api.module'; | ||
import { httpClientInMemBackendServiceFactory } from './http-client-in-memory-web-api.module'; | ||
@@ -40,5 +38,2 @@ var InMemoryWebApiModule = /** @class */ (function () { | ||
{ provide: InMemoryBackendConfig, useValue: options }, | ||
{ provide: XHRBackend, | ||
useFactory: httpInMemBackendServiceFactory, | ||
deps: [Injector, InMemoryDbService, InMemoryBackendConfig] }, | ||
{ provide: HttpBackend, | ||
@@ -45,0 +40,0 @@ useFactory: httpClientInMemBackendServiceFactory, |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"InMemoryWebApiModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":15,"character":1},"arguments":[{}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":["dbCreator","options"],"value":{"ngModule":{"__symbolic":"reference","name":"InMemoryWebApiModule"},"providers":[{"provide":{"__symbolic":"reference","module":"./interfaces","name":"InMemoryDbService","line":36,"character":19},"useClass":{"__symbolic":"reference","name":"dbCreator"}},{"provide":{"__symbolic":"reference","module":"./interfaces","name":"InMemoryBackendConfig","line":37,"character":19},"useValue":{"__symbolic":"reference","name":"options"}},{"provide":{"__symbolic":"reference","module":"@angular/http","name":"XHRBackend","line":39,"character":19},"useFactory":{"__symbolic":"reference","module":"./http-in-memory-web-api.module","name":"httpInMemBackendServiceFactory","line":40,"character":22},"deps":[{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":41,"character":17},{"__symbolic":"reference","module":"./interfaces","name":"InMemoryDbService","line":41,"character":27},{"__symbolic":"reference","module":"./interfaces","name":"InMemoryBackendConfig","line":41,"character":46}]},{"provide":{"__symbolic":"reference","module":"@angular/common/http","name":"HttpBackend","line":43,"character":19},"useFactory":{"__symbolic":"reference","module":"./http-client-in-memory-web-api.module","name":"httpClientInMemBackendServiceFactory","line":44,"character":22},"deps":[{"__symbolic":"reference","module":"./interfaces","name":"InMemoryDbService","line":45,"character":17},{"__symbolic":"reference","module":"./interfaces","name":"InMemoryBackendConfig","line":45,"character":36},{"__symbolic":"reference","module":"@angular/common/http","name":"XhrFactory","line":45,"character":59}]}]}},"forFeature":{"__symbolic":"function","parameters":["dbCreator","options"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"InMemoryWebApiModule"},"member":"forRoot"},"arguments":[{"__symbolic":"reference","name":"dbCreator"},{"__symbolic":"reference","name":"options"}]}}}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"InMemoryWebApiModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":13,"character":1},"arguments":[{}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":["dbCreator","options"],"value":{"ngModule":{"__symbolic":"reference","name":"InMemoryWebApiModule"},"providers":[{"provide":{"__symbolic":"reference","module":"./interfaces","name":"InMemoryDbService","line":34,"character":19},"useClass":{"__symbolic":"reference","name":"dbCreator"}},{"provide":{"__symbolic":"reference","module":"./interfaces","name":"InMemoryBackendConfig","line":35,"character":19},"useValue":{"__symbolic":"reference","name":"options"}},{"provide":{"__symbolic":"reference","module":"@angular/common/http","name":"HttpBackend","line":38,"character":19},"useFactory":{"__symbolic":"reference","module":"./http-client-in-memory-web-api.module","name":"httpClientInMemBackendServiceFactory","line":39,"character":22},"deps":[{"__symbolic":"reference","module":"./interfaces","name":"InMemoryDbService","line":40,"character":17},{"__symbolic":"reference","module":"./interfaces","name":"InMemoryBackendConfig","line":40,"character":36},{"__symbolic":"reference","module":"@angular/common/http","name":"XhrFactory","line":40,"character":59}]}]}},"forFeature":{"__symbolic":"function","parameters":["dbCreator","options"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"InMemoryWebApiModule"},"member":"forRoot"},"arguments":[{"__symbolic":"reference","name":"dbCreator"},{"__symbolic":"reference","name":"options"}]}}}}}}] |
export * from './backend.service'; | ||
export * from './http-status-codes'; | ||
export * from './http-backend.service'; | ||
export * from './http-client-backend.service'; | ||
export * from './in-memory-web-api.module'; | ||
export * from './http-in-memory-web-api.module'; | ||
export * from './http-client-in-memory-web-api.module'; | ||
export * from './interfaces'; |
export * from './backend.service'; | ||
export * from './http-status-codes'; | ||
export * from './http-backend.service'; | ||
export * from './http-client-backend.service'; | ||
export * from './in-memory-web-api.module'; | ||
export * from './http-in-memory-web-api.module'; | ||
export * from './http-client-in-memory-web-api.module'; | ||
export * from './interfaces'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./backend.service"},{"from":"./http-status-codes"},{"from":"./http-backend.service"},{"from":"./http-client-backend.service"},{"from":"./in-memory-web-api.module"},{"from":"./http-in-memory-web-api.module"},{"from":"./http-client-in-memory-web-api.module"},{"from":"./interfaces"}]}] | ||
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./backend.service"},{"from":"./http-status-codes"},{"from":"./http-client-backend.service"},{"from":"./in-memory-web-api.module"},{"from":"./http-client-in-memory-web-api.module"},{"from":"./interfaces"}]}] |
{ | ||
"name": "angular-in-memory-web-api", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "An in-memory web api for Angular demos and tests", | ||
@@ -33,3 +33,2 @@ "main": "bundles/in-memory-web-api.umd.js", | ||
"@angular/core": ">=6.0.0 <8.0.0", | ||
"@angular/http": ">=6.0.0 <8.0.0", | ||
"rxjs": "^6.0.0" | ||
@@ -43,3 +42,2 @@ }, | ||
"@angular/core": "^7.0.0", | ||
"@angular/http": "^7.0.0", | ||
"@angular/platform-browser": "^7.0.0", | ||
@@ -46,0 +44,0 @@ "@angular/platform-browser-dynamic": "^7.0.0", |
@@ -155,54 +155,2 @@ # Angular in-memory-web-api | ||
### Setup for the older Angular _Http_ module | ||
You can still use the in-memory web api with the older `Http` module. | ||
```ts | ||
import { HttpModule } from '@angular/http'; | ||
import { HttpInMemoryWebApiModule } from 'angular-in-memory-web-api'; | ||
import { InMemHeroService } from '../app/hero.service'; | ||
@NgModule({ | ||
imports: [ | ||
HttpModule, | ||
HttpInMemoryWebApiModule.forRoot(InMemHeroService), | ||
... | ||
], | ||
... | ||
}) | ||
export class AppModule { ... } | ||
``` | ||
### Setup for both Angular HTTP modules | ||
Perhaps you have a hybrid app with BOTH Angular modules | ||
because you're migrating to `HttpClient` from `Http`. | ||
Or perhaps you've used this library before and you don't have time | ||
at this moment to re-do your module setup. | ||
There's a combo-module | ||
(`InMemoryWebApiModule`) that prepares for both of them. | ||
It has the same syntax from pre-`v0.4.0` days and it should "_just work_" | ||
as long as you aren't using the [advanced features described below](#advanced-features). | ||
```ts | ||
import { HttpModule } from '@angular/http'; | ||
import { HttpClientModule } from '@angular/common/http'; | ||
import { InMemoryWebApiModule } from 'angular-in-memory-web-api'; | ||
import { InMemHeroService } from '../app/hero.service'; | ||
@NgModule({ | ||
imports: [ | ||
HttpModule, | ||
HttpClientModule, | ||
InMemoryWebApiModule.forRoot(InMemHeroService), | ||
... | ||
], | ||
... | ||
}) | ||
export class AppModule { ... } | ||
``` | ||
# Examples | ||
@@ -209,0 +157,0 @@ The tests (`src/app/*.spec.ts` files) in the |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3
48
469454
43
3865
460
1