Skip to content
10 seconds to build virtual interfaces in angular.
TypeScript JavaScript Shell HTML CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
build
e2e
projects/mocker
src
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
angular.json
commitlint.config.js
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

ng-mocker

10 seconds to build virtual interfaces in angular. support Angular 6.x +.

Enjoy

My sister was still in primary school, but it took her only 1 minutes to learn how to use it. It's too simple.

  1. import:

install: npm i --save ng-mocker

// in app.module.ts
import { MockerModule } from 'ng-mocker'

// ...
imports: [
  HttpClientModule,
  MockerModule.forRoot(Mocks),    // 'Mocks' is api list
],
  1. create your api:
export class Mocks {

  host: string = 'http://github.com'

  '/users/options'(req): any {
    return { message: 'ok!' }
  }
}
  1. create api with object style:
export const Mocks = {
  host: '',

  '/users/options': () => ({ message: 'ok!' })
}

when you request /users/options with angular, { message: 'ok!' } will be returned.

LICENSE

MIT

You can’t perform that action at this time.