{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/427","labels_url":"https://api.github.com/repos/angular-ui/ui-router/issues/427/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-router/issues/427/comments","events_url":"https://api.github.com/repos/angular-ui/ui-router/issues/427/events","html_url":"https://github.com/angular-ui/ui-router/issues/427","id":19556533,"number":427,"title":"Preventing state reload on URL change","user":{"login":"roryf","id":96067,"avatar_url":"https://avatars.githubusercontent.com/u/96067?v=3","gravatar_id":"","url":"https://api.github.com/users/roryf","html_url":"https://github.com/roryf","followers_url":"https://api.github.com/users/roryf/followers","following_url":"https://api.github.com/users/roryf/following{/other_user}","gists_url":"https://api.github.com/users/roryf/gists{/gist_id}","starred_url":"https://api.github.com/users/roryf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roryf/subscriptions","organizations_url":"https://api.github.com/users/roryf/orgs","repos_url":"https://api.github.com/users/roryf/repos","events_url":"https://api.github.com/users/roryf/events{/privacy}","received_events_url":"https://api.github.com/users/roryf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2013-09-16T15:15:33Z","updated_at":"2015-03-17T01:55:46Z","closed_at":"2014-04-16T02:51:37Z","body":"I currently use the following code to prevent my route, and therefore controller, being reloaded when I update the $location:\r\n```javascript\r\nangular.module('Shared').service('location', function($location, $route, $rootScope) {\r\n  $location.skipReload = function () {\r\n    var lastRoute = $route.current;\r\n    var un = $rootScope.$on('$locationChangeSuccess', function () {\r\n        $route.current = lastRoute;\r\n        un();\r\n    });\r\n    return $location;\r\n  };\r\n  return $location;\r\n});\r\n```\r\nalong with:\r\n```javascript\r\nlocation.skipReload().path(\"/newpath\").replace();\r\n```\r\n\r\nCan I achieve the same behaviour with ui-router?\r\n\r\nI tried simply replacing `$route` above with `$state` but this still resulted in a state change. My use case is I only have 'new' and 'edit' states which are exactly the same, when a user saves within the 'new' state I want to update the URL to include the saved id but not reload the view."},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/comments/82029644","html_url":"https://github.com/angular-ui/ui-router/issues/427#issuecomment-82029644","issue_url":"https://api.github.com/repos/angular-ui/ui-router/issues/427","id":82029644,"user":{"login":"heygrady","id":274076,"avatar_url":"https://avatars.githubusercontent.com/u/274076?v=3","gravatar_id":"","url":"https://api.github.com/users/heygrady","html_url":"https://github.com/heygrady","followers_url":"https://api.github.com/users/heygrady/followers","following_url":"https://api.github.com/users/heygrady/following{/other_user}","gists_url":"https://api.github.com/users/heygrady/gists{/gist_id}","starred_url":"https://api.github.com/users/heygrady/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heygrady/subscriptions","organizations_url":"https://api.github.com/users/heygrady/orgs","repos_url":"https://api.github.com/users/heygrady/repos","events_url":"https://api.github.com/users/heygrady/events{/privacy}","received_events_url":"https://api.github.com/users/heygrady/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T01:55:46Z","updated_at":"2015-03-17T01:55:46Z","body":"This seems to be a poorly documented option of the [`$state.go()`](http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state#methods_go) function. Setting the `notify` options to false seems to keep everything from refreshing.\r\n\r\n```js\r\n//change state without refreshing everything\r\n$state.go('my-state', { id: myId }, { notify: false });\r\n```"}}