2
このパッケージをインストールしました。Angular2でangular-in-memory-web-apiを使用するには?
私のモックデータクラス:
return this.http.get('api/credentials');
は、それが返されます。
InMemoryWebApiModule.forRoot(InMemoryDataService)
は今、私はこのようなものを使用しよう:私はimport
セクションの依存性を設定app.module.ts
で
import { InMemoryDbService } from 'angular-in-memory-web-api';
export class InCredentialsService implements InMemoryDbService {
public createDb() {
const credentials = {
auth: true,
id: 1,
token: 'token',
grant: 'all'
};
return credentials;
}
}
私HTTPエラー:
Response with status: 404 Not Found for URL: api/credentials
angle-in-memory-web-api rightの使い方は?