]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/cat/vandelay/display-attrs.component.ts
LP1779158 Cache new queues / display active queues
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / cat / vandelay / display-attrs.component.ts
1 import {Component, OnInit, ViewChild} from '@angular/core';
2 import {Router, ActivatedRoute, ParamMap} from '@angular/router';              
3 import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
4
5 @Component({
6   templateUrl: 'display-attrs.component.html'
7 })
8 export class DisplayAttrsComponent {
9
10     attrType: string;
11
12     constructor(
13         private router: Router,
14         private route: ActivatedRoute) {
15
16         this.route.paramMap.subscribe((params: ParamMap) => {                  
17             this.attrType = params.get('atype');
18         });
19     }
20
21     // Changing a tab in the UI means changing the route.
22     // Changing the route ultimately results in changing the tab.
23     onTabChange(evt: NgbTabChangeEvent) {
24         this.attrType = evt.nextId;
25
26         // prevent tab changing until after route navigation
27         evt.preventDefault();
28
29         const url = 
30           `/staff/cat/vandelay/display_attrs/${this.attrType}`;
31
32         this.router.navigate([url]);
33     }
34 }
35