{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/7722","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/7722/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/7722/comments","events_url":"https://api.github.com/repos/angular/angular/issues/7722/events","html_url":"https://github.com/angular/angular/issues/7722","id":142695415,"number":7722,"title":"Bug: OnInit not fired when using Safari's back button","user":{"login":"colinskow","id":5303269,"avatar_url":"https://avatars.githubusercontent.com/u/5303269?v=3","gravatar_id":"","url":"https://api.github.com/users/colinskow","html_url":"https://github.com/colinskow","followers_url":"https://api.github.com/users/colinskow/followers","following_url":"https://api.github.com/users/colinskow/following{/other_user}","gists_url":"https://api.github.com/users/colinskow/gists{/gist_id}","starred_url":"https://api.github.com/users/colinskow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinskow/subscriptions","organizations_url":"https://api.github.com/users/colinskow/orgs","repos_url":"https://api.github.com/users/colinskow/repos","events_url":"https://api.github.com/users/colinskow/events{/privacy}","received_events_url":"https://api.github.com/users/colinskow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-03-22T15:59:00Z","updated_at":"2016-04-15T08:43:42Z","closed_at":null,"body":"I am using Angular 2.0.0-beta.11 on OS X El Capitan. When Safari's browser history back function is used, `OnInit` does not get fired. It seems to work fine on Chrome.\r\n\r\nSteps to reproduce:\r\n1) Fire up the official [Tour Of Heroes Demo](https://angular.io/resources/live-examples/toh-5/ts/plnkr.html)\r\n2) Click on any hero in the dashboard\r\n3) Use the browser back button or click the \"back\" button in the demo. The dashboard doesn't populate.\r\n\r\nRelated: #4809 "},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/210364653","html_url":"https://github.com/angular/angular/issues/7722#issuecomment-210364653","issue_url":"https://api.github.com/repos/angular/angular/issues/7722","id":210364653,"user":{"login":"daslicht","id":465008,"avatar_url":"https://avatars.githubusercontent.com/u/465008?v=3","gravatar_id":"","url":"https://api.github.com/users/daslicht","html_url":"https://github.com/daslicht","followers_url":"https://api.github.com/users/daslicht/followers","following_url":"https://api.github.com/users/daslicht/following{/other_user}","gists_url":"https://api.github.com/users/daslicht/gists{/gist_id}","starred_url":"https://api.github.com/users/daslicht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daslicht/subscriptions","organizations_url":"https://api.github.com/users/daslicht/orgs","repos_url":"https://api.github.com/users/daslicht/repos","events_url":"https://api.github.com/users/daslicht/events{/privacy}","received_events_url":"https://api.github.com/users/daslicht/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T08:43:42Z","updated_at":"2016-04-15T08:43:42Z","body":"OnInit is not only fired in Angular but in JS in general :)\r\nsee, we had something similar in 2012:\r\nhttp://stackoverflow.com/questions/8788802/prevent-safari-loading-from-cache-when-back-button-is-clicked\r\n\r\nIt has something to do with the back-forward cache.\r\n\r\nSafari cache the whole page in Memory and if you navigate back the page is instantly shown without re-rendering and all scripts continue running.\r\n\r\n\r\nThe only dirty hack I have found yet its to start a time before navigating to the next page. Once you come back the timer can trigger some function.\r\n\r\n"}}