I want to get the page number out if these possible strings:
$scope.projects.next
can equal...
- string 1) /api/project/?currentuser=false&page=2
- string 2) /api/project/?page=2
I have tried this:
$scope.projects.next.split('=')[1].indexOf("page")
However, this only works on string 2. How can I change this to make sure it finds the page number no matter what position or future arguments that could be added?
I have also tried:
$scope.projects.next.indexOf("page")
but this gives 52
no idea why.