blob: e22fad0d64a54389b8f0385efaedba8a606df676 [file] [log] [blame]
Alex Perryb3168082022-01-22 13:36:13 -08001import {Component} from '@angular/core';
2
Philipp Schrader72beced2022-03-07 05:29:52 -08003type Tab = 'Entry'|'ImportMatchList';
4
Alex Perryb3168082022-01-22 13:36:13 -08005@Component({
6 selector: 'my-app',
7 templateUrl: './app.ng.html',
Philipp Schrader72beced2022-03-07 05:29:52 -08008 styleUrls: ['./common.css']
Alex Perryb3168082022-01-22 13:36:13 -08009})
10export class App {
Philipp Schrader72beced2022-03-07 05:29:52 -080011 tab: Tab = 'Entry';
12
13 tabIs(tab: Tab) {
14 return this.tab == tab;
15 }
16
17 switchTabTo(tab: Tab) {
Alex Perry19a87962022-03-12 13:36:10 -080018 let shouldSwitch = true;
19 if (tab === 'ImportMatchList') {
20 shouldSwitch = window.confirm('Leave data scouting page?');
21 }
22 if (shouldSwitch) {
23 this.tab = tab;
24 }
Philipp Schrader72beced2022-03-07 05:29:52 -080025 }
Alex Perryb3168082022-01-22 13:36:13 -080026}