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';
6 templateUrl: 'queued-record.component.html'
8 export class QueuedRecordComponent {
16 private router: Router,
17 private route: ActivatedRoute) {
19 this.route.paramMap.subscribe((params: ParamMap) => {
20 this.queueId = +params.get('id');
21 this.recordId = +params.get('recordId');
22 this.queueType = params.get('qtype');
23 this.recordTab = params.get('recordTab');
27 // Changing a tab in the UI means changing the route.
28 // Changing the route ultimately results in changing the tab.
29 onTabChange(evt: NgbTabChangeEvent) {
30 this.recordTab = evt.nextId;
32 // prevent tab changing until after route navigation
36 `/staff/cat/vandelay/queue/${this.queueType}/${this.queueId}` +
37 `/record/${this.recordId}/${this.recordTab}`;
39 this.router.navigate([url]);