seriema / angular-apimock

Automatically route your API calls to static JSON files, for hiccup free front–end development.
johansson.jp/angular-apimock
MIT License
65 stars 8 forks source link

feat(apimock): add network latency simulation #26

Closed seriema closed 9 years ago

seriema commented 9 years ago

Closes #20.

Not super-happy with having to add apiMock.getDelay() in the service because there’s no equivalent for any other config variables. But without it I can’t set the correct delay in the response. The whole separation between the service and interceptor could be improved. We need a better way to have an interceptor for mocking requests, and yet a service that client code can use.

Inspiration for implementation from here: http://www.bennadel.com/blog/2802-simulating-network-latency-in-angularjs-with-http-interceptors-and-timeout.htm