I am using query system which allows user to construct query from list of dynamic fields and I want to persist query in URL.
Normally I would do:
$stateProvider.state('alerts', {
url: '/alerts/list?p1&p2&p3'
})
and in controller I could read params with $stateParam:
console.log($stateParams.p1)
I could save query in URL by:
$state.go($state.current, {p1:'1', p2: '2'}, {location: true, inherit:true, notify:false})
But the problem is I cannot declare all params.
I would like to do:
$state.go($state.current, {p1:'1', p2: '2', p3:'3', p4: '4', p5:'5'}, {location: true, inherit:true, notify:false})
but ui-router ignores params that are no declared for state.
I know $location.search gives me access to URL search part but how can I set URL (without changing state and reloading page)?