0

When I use ngRoute I can get all params and queryParams such search and sectionId:

// Given:
// URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
// Route: /Chapter/:chapterId/Section/:sectionId
//
// Then
$routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}

But when I use angularjs ui-route I have stateParams which not give me the all the data like routeParams give me.

Is there another service i can use to get all the data like routeParams does?

Jon Sud
  • 10,211
  • 17
  • 76
  • 174
  • Maybe [this](https://github.com/angular-ui/ui-router/wiki/URL-Routing#query-parameters) will help you – Raxel21 Nov 17 '21 at 02:13

1 Answers1

0

try with $state.params. value should be:

{ search:'moby' }
AnC Dev
  • 141
  • 12
  • Check https://stackoverflow.com/questions/19053991/how-to-extract-query-parameters-with-ui-router-for-angularjs – AnC Dev Nov 17 '21 at 11:58