chore: update samples to "angular-in-memory-web-api" (#2472)
chore: update samples to "angular-in-memory-web-api"
This commit is contained in:
parent
738b714bd3
commit
6e17d33475
|
@ -9,7 +9,7 @@ import { LocationStrategy,
|
|||
import { NgModule } from '@angular/core';
|
||||
|
||||
import { HeroData } from './hero-data';
|
||||
import { InMemoryWebApiModule } from 'angular2-in-memory-web-api';
|
||||
import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
|
||||
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
"@angular/platform-server": "2.0.0",
|
||||
"@angular/router": "3.0.0",
|
||||
"@angular/upgrade": "2.0.0",
|
||||
"angular2-in-memory-web-api": "0.0.20",
|
||||
"angular-in-memory-web-api": "0.1.0",
|
||||
"bootstrap": "^3.3.6",
|
||||
"core-js": "^2.4.1",
|
||||
"reflect-metadata": "^0.1.3",
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
// other libraries
|
||||
'rxjs': 'npm:rxjs',
|
||||
'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
|
||||
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api',
|
||||
},
|
||||
// packages tells the System loader how to load when no filename and/or no extension
|
||||
packages: {
|
||||
|
@ -37,7 +37,7 @@
|
|||
rxjs: {
|
||||
defaultExtension: 'js'
|
||||
},
|
||||
'angular2-in-memory-web-api': {
|
||||
'angular-in-memory-web-api': {
|
||||
main: './index.js',
|
||||
defaultExtension: 'js'
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { BrowserModule } from '@angular/platform-browser';
|
|||
import { FormsModule } from '@angular/forms';
|
||||
import { HttpModule, JsonpModule } from '@angular/http';
|
||||
|
||||
import { InMemoryWebApiModule } from 'angular2-in-memory-web-api';
|
||||
import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
|
||||
import { HeroData } from './hero-data';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// #docregion
|
||||
import { InMemoryDbService } from 'angular2-in-memory-web-api';
|
||||
import { InMemoryDbService } from 'angular-in-memory-web-api';
|
||||
export class HeroData implements InMemoryDbService {
|
||||
createDb() {
|
||||
let heroes = [
|
||||
|
|
|
@ -15,14 +15,14 @@ import { Observable } from 'rxjs/Observable';
|
|||
|
||||
@Injectable()
|
||||
export class HeroService {
|
||||
// #docregion ctor
|
||||
constructor (private http: Http) {}
|
||||
// #enddocregion ctor
|
||||
|
||||
// #docregion endpoint
|
||||
private heroesUrl = 'app/heroes'; // URL to web API
|
||||
// #enddocregion endpoint
|
||||
|
||||
// #docregion ctor
|
||||
constructor (private http: Http) {}
|
||||
// #enddocregion ctor
|
||||
|
||||
// #docregion methods, error-handling, http-get
|
||||
getHeroes (): Observable<Hero[]> {
|
||||
return this.http.get(this.heroesUrl)
|
||||
|
|
|
@ -3,7 +3,7 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { InMemoryWebApiModule } from 'angular2-in-memory-web-api';
|
||||
import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
|
||||
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
// other libraries
|
||||
'rxjs': 'npm:rxjs',
|
||||
'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
|
||||
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api',
|
||||
},
|
||||
// packages tells the System loader how to load when no filename and/or no extension
|
||||
packages: {
|
||||
|
@ -37,7 +37,7 @@
|
|||
rxjs: {
|
||||
defaultExtension: 'js'
|
||||
},
|
||||
'angular2-in-memory-web-api': {
|
||||
'angular-in-memory-web-api': {
|
||||
main: './index.js',
|
||||
defaultExtension: 'js'
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
// other libraries
|
||||
'rxjs': 'npm:rxjs',
|
||||
'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
|
||||
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api',
|
||||
'ts': 'npm:plugin-typescript@4.0.10/lib/plugin.js',
|
||||
'typescript': 'npm:typescript@2.0.2/lib/typescript.js',
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
|||
rxjs: {
|
||||
defaultExtension: 'js'
|
||||
},
|
||||
'angular2-in-memory-web-api': {
|
||||
'angular-in-memory-web-api': {
|
||||
main: './index.js',
|
||||
defaultExtension: 'js'
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
// other libraries
|
||||
'rxjs': 'npm:rxjs',
|
||||
'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
|
||||
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api',
|
||||
'ts': 'npm:plugin-typescript@4.0.10/lib/plugin.js',
|
||||
'typescript': 'npm:typescript@2.0.2/lib/typescript.js',
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
|||
rxjs: {
|
||||
defaultExtension: 'js'
|
||||
},
|
||||
'angular2-in-memory-web-api': {
|
||||
'angular-in-memory-web-api': {
|
||||
main: './index.js',
|
||||
defaultExtension: 'js'
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import { HttpModule } from '@angular/http';
|
|||
|
||||
// #enddocregion v1
|
||||
// Imports for loading & configuring the in-memory web api
|
||||
import { InMemoryWebApiModule } from 'angular2-in-memory-web-api';
|
||||
import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
|
||||
import { InMemoryDataService } from './in-memory-data.service';
|
||||
|
||||
// #docregion v1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// #docregion , init
|
||||
import { InMemoryDbService } from 'angular2-in-memory-web-api';
|
||||
import { InMemoryDbService } from 'angular-in-memory-web-api';
|
||||
export class InMemoryDataService implements InMemoryDbService {
|
||||
createDb() {
|
||||
let heroes = [
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
'app': '/app', // 'dist',
|
||||
|
||||
'@angular': '/node_modules/@angular',
|
||||
'angular2-in-memory-web-api': '/node_modules/angular2-in-memory-web-api',
|
||||
'angular-in-memory-web-api': '/node_modules/angular-in-memory-web-api',
|
||||
'rxjs': '/node_modules/rxjs'
|
||||
};
|
||||
|
||||
var packages = {
|
||||
'/app': { main: 'main.js', defaultExtension: 'js' },
|
||||
'rxjs': { defaultExtension: 'js' },
|
||||
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
|
||||
'angular-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
|
||||
};
|
||||
// #enddocregion paths
|
||||
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
'app': '/app', // 'dist',
|
||||
|
||||
'@angular': '/node_modules/@angular',
|
||||
'angular2-in-memory-web-api': '/node_modules/angular2-in-memory-web-api',
|
||||
'angular-in-memory-web-api': '/node_modules/angular-in-memory-web-api',
|
||||
'rxjs': '/node_modules/rxjs'
|
||||
};
|
||||
|
||||
var packages = {
|
||||
'/app': { main: 'main.js', defaultExtension: 'js' },
|
||||
'rxjs': { defaultExtension: 'js' },
|
||||
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
|
||||
'angular-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
|
||||
};
|
||||
// #enddocregion paths
|
||||
|
||||
|
|
|
@ -669,7 +669,7 @@ a#in-mem-web-api
|
|||
.l-sub-section
|
||||
:marked
|
||||
The in-memory web api is not part of the Angular core.
|
||||
It's an optional service in its own `angular2-in-memory-web-api` library
|
||||
It's an optional service in its own `angular-in-memory-web-api` library
|
||||
that we installed with npm (see `package.json`) and
|
||||
registered for module loading by SystemJS (see `systemjs.config.js`)
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ a(id="other")
|
|||
:marked
|
||||
### Other helper libraries
|
||||
|
||||
***angular2-in-memory-web-api*** - An Angular-supported library that simulates a remote server's web api
|
||||
***angular-in-memory-web-api*** - An Angular-supported library that simulates a remote server's web api
|
||||
without requiring an actual server or real http calls.
|
||||
Good for demos, samples, and early stage development (before we even have a server).
|
||||
Read about it in the [Http Client](server-communication.html#appendix-tour-of-heroes-in-memory-server) page.
|
||||
|
|
|
@ -654,7 +654,7 @@ a#in-mem-web-api
|
|||
.l-sub-section
|
||||
:marked
|
||||
The in-memory web api is not part of the Angular core.
|
||||
It's an optional service in its own `angular2-in-memory-web-api` library
|
||||
It's an optional service in its own `angular-in-memory-web-api` library
|
||||
that we installed with npm (see `package.json`) and
|
||||
registered for module loading by SystemJS (see `systemjs.config.js`)
|
||||
|
||||
|
|
Loading…
Reference in New Issue