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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

mysql - Pass value between different pages (form) with PHP -