File tree Expand file tree Collapse file tree 6 files changed +9
-8
lines changed
app/components/+tabs/demos/basic Expand file tree Collapse file tree 6 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
< div >
2
2
< tabset >
3
- < tab heading ="Static title "> Static content</ tab >
3
+ < tab heading ="Static title " id =" tab1 " > Static content</ tab >
4
4
< tab heading ="Static Title 1 "> Static content 1</ tab >
5
5
< tab heading ="Static Title 2 "> Static content 2</ tab >
6
6
< tab (select) ="alertMe() ">
Original file line number Diff line number Diff line change 1
- import { Component , ViewChild } from '@angular/core' ;
2
- import { TabsetComponent } from 'ngx-bootstrap' ;
1
+ import { Component } from '@angular/core' ;
3
2
4
3
@Component ( {
5
4
selector : 'demo-tabs-basic' ,
Original file line number Diff line number Diff line change 1
- {"version" :" 2.0.0-beta.5 " }
1
+ {"version" :" 2.0.0-beta.6 " }
Original file line number Diff line number Diff line change @@ -2464,7 +2464,7 @@ export const ngdoc: any = {
2464
2464
{
2465
2465
"name" : "id" ,
2466
2466
"type" : "string" ,
2467
- "description" : "<p>tab id </p>\n"
2467
+ "description" : "<p>tab id. The same id with suffix '-link' will be added to the corresponding <li> element </p>\n"
2468
2468
} ,
2469
2469
{
2470
2470
"name" : "removable" ,
Original file line number Diff line number Diff line change @@ -15,9 +15,10 @@ import { TabsetComponent } from './tabset.component';
15
15
@Directive ( { selector : 'tab, [tab]' } )
16
16
export class TabDirective implements OnInit , OnDestroy {
17
17
/** tab header text */
18
- @Input ( ) heading : string ;
19
- /** tab id */
20
- @Input ( ) id : string ;
18
+ @Input ( ) public heading : string ;
19
+ /** tab id. The same id with suffix '-link' will be added to the corresponding <li> element */
20
+ @HostBinding ( 'attr.id' )
21
+ @Input ( ) public id : string ;
21
22
/** if true tab can not be activated */
22
23
@Input ( ) disabled : boolean ;
23
24
/** if true tab can be removable, additional button will appear */
Original file line number Diff line number Diff line change 2
2
< li *ngFor ="let tabz of tabs " [ngClass] ="['nav-item', tabz.customClass || ''] "
3
3
[class.active] ="tabz.active " [class.disabled] ="tabz.disabled ">
4
4
< a href ="javascript:void(0); " class ="nav-link "
5
+ [attr.id] ="tabz.id ? tabz.id + '-link' : '' "
5
6
[class.active] ="tabz.active " [class.disabled] ="tabz.disabled "
6
7
(click) ="tabz.active = true ">
7
8
< span [ngTransclude] ="tabz.headingRef "> {{ tabz.heading }}</ span >
You can’t perform that action at this time.
0 commit comments