{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/7593","repository_url":"https://api.github.com/repos/driftyco/ionic","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/7593/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/7593/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/7593/events","html_url":"https://github.com/driftyco/ionic/issues/7593","id":169822380,"number":7593,"title":"Ionic2 - navCtrl.setRoot does not work for Tab pages ","user":{"login":"itemir","id":8331463,"avatar_url":"https://avatars.githubusercontent.com/u/8331463?v=3","gravatar_id":"","url":"https://api.github.com/users/itemir","html_url":"https://github.com/itemir","followers_url":"https://api.github.com/users/itemir/followers","following_url":"https://api.github.com/users/itemir/following{/other_user}","gists_url":"https://api.github.com/users/itemir/gists{/gist_id}","starred_url":"https://api.github.com/users/itemir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itemir/subscriptions","organizations_url":"https://api.github.com/users/itemir/orgs","repos_url":"https://api.github.com/users/itemir/repos","events_url":"https://api.github.com/users/itemir/events{/privacy}","received_events_url":"https://api.github.com/users/itemir/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/driftyco/ionic/labels/platform:ios","name":"platform:ios","color":"0052cc"},{"url":"https://api.github.com/repos/driftyco/ionic/labels/v2","name":"v2","color":"313744"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-07T23:29:59Z","updated_at":"2016-08-18T15:40:11Z","closed_at":"2016-08-08T02:01:30Z","body":"In Ionic 2.0.0-beta.11, If you setRoot to a different page from the tabs page initially, setRoot back to tabs page from that page brings a blank page.\r\n\r\nOne use case for this scenario is user login. Imagine you want to send the user to a login page if they are not already logged in. And after logging in, you want to send them back to the main page. \r\n\r\nHere are the steps to reproduce from scratch with a simplified flow.\r\n\r\n**Step 1** Start a new project with \"ionic start TestApp --ts --v2\"\r\n**Step 2** Change the constructor section of \"app/pages/tabs/tabs.ts\" to following: \r\n```\r\nconstructor(navCtrl: NavController) {\r\n    let username = window.localStorage.getItem('username');\r\n    if (username) {\r\n        // this tells the tabs component which Pages\r\n        // should be each tab's root Page\r\n        this.tab1Root = HomePage;\r\n        this.tab2Root = AboutPage;\r\n        this.tab3Root = ContactPage;\r\n    } else {\r\n      navCtrl.setRoot(HomePage);\r\n    }\r\n  }\r\n```\r\n**Step 3** Modify \"app/pages/home/home.ts\" as follows:\r\n```\r\nexport class HomePage {\r\n  constructor(\r\n    public navCtrl: NavController\r\n  ) {}\r\n  doFakeLogin() {\r\n    window.localStorage.setItem('username','somevalue');\r\n    this.navCtrl.setRoot(TabsPage);\r\n  }\r\n}\r\n```\r\n**Step 4** Add a button to \"app/pages/home/home.html\" as follows:\r\n```\r\n<button (click)=\"doFakeLogin()\" primary block>Fake Login</button>\r\n```\r\n**Step 5** Launch the app with \"ionic emulate ios\" \r\n**Step 6** Click \"Fake Login\" button that appears in the emulator.\r\n**Step 7** You will see a blank white screen. I expect to see the actual tabs page on this screen. \r\n\r\nHere is the ouput of \"ionic info\":\r\n\r\n```\r\nYour system information:\r\n\r\nCordova CLI: 6.2.0\r\nIonic Framework Version: 2.0.0-beta.11\r\nIonic CLI Version: 2.0.0-beta.32\r\nIonic App Lib Version: 2.0.0-beta.18\r\nios-deploy version: 1.8.6\r\nios-sim version: 5.0.8\r\nOS: Mac OS X El Capitan\r\nNode Version: v4.4.3\r\nXcode version: Xcode 7.3.1 Build version 7D1014\r\n```"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/240764085","html_url":"https://github.com/driftyco/ionic/issues/7593#issuecomment-240764085","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/7593","id":240764085,"user":{"login":"carlosrodrigome","id":15386938,"avatar_url":"https://avatars.githubusercontent.com/u/15386938?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosrodrigome","html_url":"https://github.com/carlosrodrigome","followers_url":"https://api.github.com/users/carlosrodrigome/followers","following_url":"https://api.github.com/users/carlosrodrigome/following{/other_user}","gists_url":"https://api.github.com/users/carlosrodrigome/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosrodrigome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosrodrigome/subscriptions","organizations_url":"https://api.github.com/users/carlosrodrigome/orgs","repos_url":"https://api.github.com/users/carlosrodrigome/repos","events_url":"https://api.github.com/users/carlosrodrigome/events{/privacy}","received_events_url":"https://api.github.com/users/carlosrodrigome/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T15:40:11Z","updated_at":"2016-08-18T15:40:11Z","body":"I'm in the beta 11 and that works fine to solve the issue"}}
{"actor":{"display_login":"carlosrodrigome"}}