{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/4078","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/4078/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/4078/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/4078/events","html_url":"https://github.com/driftyco/ionic/issues/4078","id":94743133,"number":4078,"title":"Navigation and history","user":{"login":"Leftyx","id":171024,"avatar_url":"https://avatars.githubusercontent.com/u/171024?v=3","gravatar_id":"","url":"https://api.github.com/users/Leftyx","html_url":"https://github.com/Leftyx","followers_url":"https://api.github.com/users/Leftyx/followers","following_url":"https://api.github.com/users/Leftyx/following{/other_user}","gists_url":"https://api.github.com/users/Leftyx/gists{/gist_id}","starred_url":"https://api.github.com/users/Leftyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leftyx/subscriptions","organizations_url":"https://api.github.com/users/Leftyx/orgs","repos_url":"https://api.github.com/users/Leftyx/repos","events_url":"https://api.github.com/users/Leftyx/events{/privacy}","received_events_url":"https://api.github.com/users/Leftyx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-13T15:08:20Z","updated_at":"2015-07-13T15:08:22Z","closed_at":null,"body":"**Type**: bug\r\n\r\n**Platform**: all\r\n\r\nI've found a few questions on StackOverflow about navigation, history and how it should work. \r\nMost people - and myself - struggle to understand how things are supposed to work.\r\n\r\nThere a [codepen](http://codepen.io/anon/pen/Kpepwx?editors=101) here where I am trying to figure why history doesn't always remember the last view rendered.  \r\n\r\nUsing the sequence: Home - Fact1 - Fact2 - Fact3 - Fact2\r\n\r\nyou can see the back button shows Fact1. I would expect Fact3.\r\n\r\nGoing through the code base I kind of figured out why that happens. It seems that $ionicHistory keeps track of all the views storing them in a collection. If the element is already in the collection, it is fetched using the info attached to it.\r\n\r\nThe view Fact2 was previously rendered and it's back view was Fact1.\r\n\r\nIf you try another sequence, though: Home - Fact1 - Fact2 - Home \r\n\r\nYou notice that the back button now is **Fact2**. Home should be the root and it should not have any back button.\r\nIf I play the same sequence over and over: Home - Fact1 - Fact2 - Home - Fact1 - Fact2 - Home\r\netc etc I can see the collection views of **$ionicHistory.viewHistory()** grows indefinitely."},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/120961739","html_url":"https://github.com/driftyco/ionic/issues/4078#issuecomment-120961739","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/4078","id":120961739,"user":{"login":"Ionitron","id":6591344,"avatar_url":"https://avatars.githubusercontent.com/u/6591344?v=3","gravatar_id":"","url":"https://api.github.com/users/Ionitron","html_url":"https://github.com/Ionitron","followers_url":"https://api.github.com/users/Ionitron/followers","following_url":"https://api.github.com/users/Ionitron/following{/other_user}","gists_url":"https://api.github.com/users/Ionitron/gists{/gist_id}","starred_url":"https://api.github.com/users/Ionitron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ionitron/subscriptions","organizations_url":"https://api.github.com/users/Ionitron/orgs","repos_url":"https://api.github.com/users/Ionitron/repos","events_url":"https://api.github.com/users/Ionitron/events{/privacy}","received_events_url":"https://api.github.com/users/Ionitron/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T15:08:22Z","updated_at":"2015-07-13T15:08:22Z","body":"Greetings @Leftyx!\n\nMy sensors indicate that you need to update your issue through our [custom issue form](http://ionicframework.com/submit-issue/#/?iid=4078). We are now requiring all issues to be submitted this way, to ensure that we have all of the information necessary to fix them as quickly as possible.\n\n**[Click Here To Update Your Issue](http://ionicframework.com/submit-issue/#/?iid=4078)**\n\nI will have no choice but to close this issue if it is not resubmitted through the form. Please fill out the rest of the form, so that I may use my friendly robot powers to assist you.\n\nThank you!\n\n<span ionitron-issue-resubmit></span>"}}