1 import { AfterViewInit, Component, ViewChild } from '@angular/core'
2 import { TabsetComponent } from 'ngx-bootstrap/tabs'
5 templateUrl: './follows.component.html',
6 styleUrls: [ './follows.component.scss' ]
8 export class FollowsComponent implements AfterViewInit {
9 @ViewChild('followsMenuTabs') followsMenuTabs: TabsetComponent
13 path: 'following-list',
17 path: 'following-add',
21 path: 'followers-list',
27 // Avoid issue with change detector
28 setTimeout(() => this.updateActiveTab())
31 private updateActiveTab () {
32 const url = window.location.pathname
34 for (let i = 0; i < this.links.length; i++) {
35 const path = this.links[i].path
37 if (url.endsWith(path) === true) {
38 this.followsMenuTabs.tabs[i].active = true