Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { action } from '@ember-decorators/object';
- export default class AutoBind {
- end = false;
- constructor() {
- window.addEventListener('beforeunload', this.onDestroy);
- }
- @action
- onDestroy(event) {
- this.end = true;
- console.log(this.end);
- event.preventDefault();
- event.returnValue = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement