Skip to content

Commit

Permalink
Add window:beforeunload
Browse files Browse the repository at this point in the history
  • Loading branch information
joelthorner committed Mar 14, 2019
1 parent 78b6146 commit b8ac775
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<eg-sidebar></eg-sidebar>
</div>
<div class="eg-outlet">
<router-outlet></router-outlet>
<router-outlet (window:beforeunload)="doBeforeUnload()"></router-outlet>
</div>
</div>
</div>
Expand Down
7 changes: 7 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component } from '@angular/core';
import { AuthService } from './lib/services/auth.service';
import { environment } from 'src/environments/environment';

@Component({
selector: 'eg-root',
Expand All @@ -8,4 +9,10 @@ import { AuthService } from './lib/services/auth.service';
})
export class AppComponent {
constructor(public auth: AuthService) {}

doBeforeUnload() {
if (environment.production) {
return false;
}
}
}

0 comments on commit b8ac775

Please sign in to comment.