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: 'display-attrs.component.html'
8 export class DisplayAttrsComponent {
13 private router: Router,
14 private route: ActivatedRoute) {
16 this.route.paramMap.subscribe((params: ParamMap) => {
17 this.attrType = params.get('atype');
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;
26 // prevent tab changing until after route navigation
30 `/staff/cat/vandelay/display_attrs/${this.attrType}`;
32 this.router.navigate([url]);