src/app/ceph/block/iscsi-tabs/iscsi-tabs.component.ts
selector | cd-iscsi-tabs |
styleUrls | ./iscsi-tabs.component.scss |
templateUrl | ./iscsi-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-iscsi-tabs',
templateUrl: './iscsi-tabs.component.html',
styleUrls: ['./iscsi-tabs.component.scss']
})
export class IscsiTabsComponent implements OnInit {
url: string;
constructor(private router: Router) {}
ngOnInit() {
this.url = this.router.url;
}
navigateTo(url) {
this.router.navigate([url]);
}
}
<tabset>
<tab heading="Overview"
i18n-heading
[active]="url === '/block/iscsi/overview'"
(select)="navigateTo('/block/iscsi/overview')">
</tab>
<tab heading="Targets"
i18n-heading
[active]="url === '/block/iscsi/targets'"
(select)="navigateTo('/block/iscsi/targets')">
</tab>
</tabset>
./iscsi-tabs.component.scss