angular-hint
angular-hint copied to clipboard
fix(hint): properly clean up when location is changed before DOM content has been loaded
The beforeunload event was never fired is the location was changed before the DOM content had been loaded (e.g. directly inside a <script> tag. The unload event is fired more consistently.
Fixes https://github.com/angular/batarang/issues/290
This mostly affects batarang (which runs on Chrome only), but I don't see any reason not to play it safe(r), by hooking into both events. At least, this way it will be at least as good as it was before this PR.
@Narretz, PTAL.