{"action":"created","issue":{"url":"https://api.github.com/repos/linnovate/mean/issues/1320","labels_url":"https://api.github.com/repos/linnovate/mean/issues/1320/labels{/name}","comments_url":"https://api.github.com/repos/linnovate/mean/issues/1320/comments","events_url":"https://api.github.com/repos/linnovate/mean/issues/1320/events","html_url":"https://github.com/linnovate/mean/issues/1320","id":102732138,"number":1320,"title":"How to override 'home' state from system package in custom package","user":{"login":"pbharatprdxn","id":6283622,"avatar_url":"https://avatars.githubusercontent.com/u/6283622?v=3","gravatar_id":"","url":"https://api.github.com/users/pbharatprdxn","html_url":"https://github.com/pbharatprdxn","followers_url":"https://api.github.com/users/pbharatprdxn/followers","following_url":"https://api.github.com/users/pbharatprdxn/following{/other_user}","gists_url":"https://api.github.com/users/pbharatprdxn/gists{/gist_id}","starred_url":"https://api.github.com/users/pbharatprdxn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbharatprdxn/subscriptions","organizations_url":"https://api.github.com/users/pbharatprdxn/orgs","repos_url":"https://api.github.com/users/pbharatprdxn/repos","events_url":"https://api.github.com/users/pbharatprdxn/events{/privacy}","received_events_url":"https://api.github.com/users/pbharatprdxn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-24T08:00:55Z","updated_at":"2015-08-27T11:53:41Z","closed_at":null,"body":"$viewPathProvider allows us to override the views but I searched through the documentation and even the issues, but couldn't find a way to override the 'state'.\r\n\r\nMy scenario is such that I want my view to be seen only when the user has 'logged in', I can use this resolve function - \r\nresolve: {\r\n          loggedin: function(MeanUser) {\r\n            return MeanUser.checkLoggedin();\r\n          }\r\n        }\r\nto my state, which also gets invoked on default route - '/'. \r\n\r\nNow two solutions can work in my scenario:\r\n1. If I can override the entire state itself \r\n2. If I can reorder the packages so that my custom package's routes runs before system's, in that case my custom package's route will execute first and thus it will run the resolve function and I will go home happy :)\r\n\r\nThanks in anticipation.\r\n"},"comment":{"url":"https://api.github.com/repos/linnovate/mean/issues/comments/135398880","html_url":"https://github.com/linnovate/mean/issues/1320#issuecomment-135398880","issue_url":"https://api.github.com/repos/linnovate/mean/issues/1320","id":135398880,"user":{"login":"claustres","id":2647117,"avatar_url":"https://avatars.githubusercontent.com/u/2647117?v=3","gravatar_id":"","url":"https://api.github.com/users/claustres","html_url":"https://github.com/claustres","followers_url":"https://api.github.com/users/claustres/followers","following_url":"https://api.github.com/users/claustres/following{/other_user}","gists_url":"https://api.github.com/users/claustres/gists{/gist_id}","starred_url":"https://api.github.com/users/claustres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claustres/subscriptions","organizations_url":"https://api.github.com/users/claustres/orgs","repos_url":"https://api.github.com/users/claustres/repos","events_url":"https://api.github.com/users/claustres/events{/privacy}","received_events_url":"https://api.github.com/users/claustres/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T11:53:41Z","updated_at":"2015-08-27T11:53:41Z","body":"I used to manage this by making the home page display different information depending on the authentication state, something like this :\r\n```html\r\n...\r\n<p class=\"alert alert-info\" data-ng-hide=\"hdrctr.hdrvars.authenticated\">\r\nFirst, you have to <a href=\"/#!/auth/login\">login</a> or <a href=\"/#!/auth/register\">register</a>.\r\n</p>\r\n\r\n<p class=\"alert alert-info\" data-ng-show=\"hdrctr.hdrvars.authenticated\">\r\nAs you are already logged in, you have experienced user authentication.\r\n</p>\r\n...\r\n```\r\n"}}