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.
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