Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Releases: the-front/angular-mocks-backend

v0.1.7

26 Jan 21:31
Compare
Choose a tag to compare

code reviewed to work with angular mock 1.3.9

v0.1.6

09 Oct 13:49
Compare
Choose a tag to compare

Repository moved from [GitHub] erkobridee user to [GitHub] the-front organization

v0.1.5

01 Oct 03:09
Compare
Choose a tag to compare

review to work with angularjs 1.2.10+

31 Mar 20:03
Compare
Choose a tag to compare
  // provider

    // You can also just use provide to blanket replace $httpBackend 
    // with the mock
  ngMockBackend.config(

    ['$provide', 

  function($provide) {

    var obj = new angular.mock.$HttpBackendProvider(),
        createHttpBackendMock = obj.$get[1];

    // Decorate by passing in the constructor for mock $httpBackend
    $provide.decorator('$httpBackend', createHttpBackendMock);

  }]);

new service available : getParams

15 Oct 12:12
Compare
Choose a tag to compare
angular.mock.backend.addResource(function(getParams) {

  var url = '/user?param1=abc&param2=def';

  var paramMap = getParams(url);

  console.log(paramMap.param1); // abc

  console.log(paramMap.param2); // def

});

configure backend mock resources with AngularJS $injector

11 Oct 02:49
Compare
Choose a tag to compare
  • regexpUrl

isolated in one scope, and added more intelligence, that's allow, configure some regexp using string or RegExp object

with this, now it's possible to configure resource, like service, factory or controller, with dependency injection

angular.mock.backend.addResource(function($rootScope, httpBackend, regexpUrl) { ... });

or

angular.mock.backend.addResource(
  [ '$rootScope', '$httpBackend', 'regexpUrl',
function(scope, httpBackend, regexpUrl) { ... }]);

bugfix - allow angular request load html templates to server

11 Oct 01:50
Compare
Choose a tag to compare

configure allow regexp role on $httpBackend to find .html at end of some http GET request

$httpBackend.when('GET', regexpUrl(/.html$/)).passThrough();

first version

11 Oct 01:44
Compare
Choose a tag to compare
first version Pre-release
Pre-release

version number following Semantic Versioning pattern

this library extends angular-mock.js to enable prototype application without some backend support, based on ideias present in this post: Prototype Angular UIs Without A Backend | OpenSource Connections | [jsfiddle] example