Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(ngMock/angular-mocks) added response to whenPOST mock #6761

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ngMock/angular-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,9 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
*
* // adds a new phone to the phones array
* $httpBackend.whenPOST('/phones').respond(function(method, url, data) {
* phones.push(angular.fromJson(data));
* var phone = angular.fromJson(data);
* phones.push(phone);
* return [200, phone, {}];
* });
* $httpBackend.whenGET(/^\/templates\//).passThrough();
* //...
Expand Down