Hi,

I would to like to mock http requests not only for test but also for usual 
development. 

So I tried MockBackend which has the problem that also http request for 
images etc. are handled by MockBackend.
This means a more flexible solution has to be used.

Next approach was to extend the Http class and do the magic on my own. This 
works fine execpt error handling.

When I would like to return an error from my mocked http call I tried a 
construct like this:


...

let response = new Response(new ResponseOptions({ body: e, status: 
errorStatusCode, type: ResponseType.Error }));
response.ok = false;
return Observable.of(response);



But it seems this is recognized as successful response.

Does anybody of you know a solution to this problem?

TIA

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to