Skip to content

Instantly share code, notes, and snippets.

@benschw
Last active December 17, 2015 00:09
Show Gist options
  • Save benschw/5518392 to your computer and use it in GitHub Desktop.
Save benschw/5518392 to your computer and use it in GitHub Desktop.
$stateParams Service and GET parameters
// If you had a url on your state of:
url: '/users/:id/details/{type}/{repeat:[0-9]+}?from&to'
// Then you navigated your browser to:
'/users/123/details//0'
// Your $stateParams object would be
{ id:'123', type:'', repeat:'0' }
// Then you navigated your browser to:
'/users/123/details/default/0?from=there&to=here'
// Your $stateParams object would be
{ id:'123', type:'default', repeat:'0', from='there', to='here' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment