Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$httpBackend.whenGET with more than one parameter

I have this URL to match:

$httpBackend.whenGET('/api/alerts/1121212156/0/4/0').repond(someObject)

The problem is that 1121212156 is a tick so it can be different every time. Does someone know how to create a regex to do that?

like image 556
Miguel Garcia Boriani Avatar asked Apr 10 '26 07:04

Miguel Garcia Boriani


1 Answers

$httpBackend.whenGET(/\api/alerts/[0-9]+/2/4/0/). respond(someObject);

like image 111
Miguel Garcia Boriani Avatar answered Apr 12 '26 00:04

Miguel Garcia Boriani