src/app/core/auth/user-tabs/user-tabs.component.ts
selector | cd-user-tabs |
styleUrls | ./user-tabs.component.scss |
templateUrl | ./user-tabs.component.html |
Properties |
Methods |
constructor(router: Router)
|
||||||
Parameters :
|
navigateTo | ||||
navigateTo(url)
|
||||
Parameters :
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
url |
Type : string
|
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'cd-user-tabs',
templateUrl: './user-tabs.component.html',
styleUrls: ['./user-tabs.component.scss']
})
export class UserTabsComponent implements OnInit {
url: string;
constructor(private router: Router) {}
ngOnInit() {
this.url = this.router.url;
}
navigateTo(url) {
this.router.navigate([url]);
}
}
<tabset>
<tab heading="Users"
i18n-heading
[active]="url === '/user-management/users'"
(select)="navigateTo('/user-management/users')">
</tab>
<tab heading="Roles"
i18n-heading
[active]="url === '/user-management/roles'"
(select)="navigateTo('/user-management/roles')">
</tab>
</tabset>
./user-tabs.component.scss