Is it possible to use wild cards in angularjs mocks -
is possible use wild cards in angular mocks? example:
$httpbackend.when('get', '/api/checklists/*').respond({ userid: 'userx' }, { 'a-token': 'xxx' }); rather than:
$httpbackend.when('get', '/api/checklists/123').respond({ userid: 'userx' }, { 'a-token': 'xxx' });
the documentation suggests takes in regular expression, can this:
$httpbackend.when('get', /\/api\/checklists\/[1-9][0-9]*/) this require match integer id length of @ least 1, not starting zero. of course, example. create own regular expressions match.
Comments
Post a Comment