try { var $httpBackend; describe('mycontroller', function () { beforeEach(module('app')); it('scopeTestSpec', inject(function ($controller, $rootScope, $injector) { var $scope = $rootScope.$new(); $controller('MyController', { $scope: $scope }); $httpBackend = $injector.get('$httpBackend'); var sample = []; sample = { Email: "abc@gmail.com", Password: "1111" }; $httpBackend.whenPOST('URL',sample).respond(function (method, url, data, headers) { console.log('Received these data:', method, url, data, headers); }); $httpBackend.flush(); })); }); } catch (e) { alert(e); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)