ngMock.$httpBackend.expectGET()

expectGET(url, [headers], [keys]);

Creates a new request expectation for GET requests. For more info see expect().

Parameters

Param Type Details
url stringRegExpfunction(string)

HTTP url or function that receives a url and returns true if the url matches the current definition.

headers
(optional)
Object

HTTP headers.

keys
(optional)
Array

Array of keys to assign to regex matches in request url described above.

Returns

requestHandler

Returns an object with respond method that controls how a matched request is handled. You can save this object for later use and invoke respond again in order to change how a matched request is handled. See #expect for more info.

doc_AngularJS
2016-03-29 16:12:00
Comments
Leave a Comment

Please login to continue.