File

src/app/core/auth/user-tabs/user-tabs.component.ts

Implements

OnInit

Metadata

selector cd-user-tabs
styleUrls ./user-tabs.component.scss
templateUrl ./user-tabs.component.html

Index

Properties
Methods

Constructor

constructor(router: Router)
Parameters :
Name Type Optional
router Router No

Methods

navigateTo
navigateTo(url)
Parameters :
Name Optional
url No
Returns : void
ngOnInit
ngOnInit()
Returns : void

Properties

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

Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""