File tree 2 files changed +8
-4
lines changed
apps/daffio/src/app/docs/components/docs-list
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 5
5
</ ng-template >
6
6
7
7
< ng-template #daffTreeItemTpl let-node >
8
- < a daffTreeItem [node] ="node " [routerLink] ="node.url "> {{ node.title }}</ a >
8
+ < a daffTreeItem [selected] =" rla.isActive " routerLinkActive [routerLinkActiveOptions] =" ROUTER_LINK_ACTIVE_CONFIG " #rla =" routerLinkActive " [ node] ="node " [routerLink] ="node.url "> {{ node.title }}</ a >
9
9
</ ng-template >
10
10
</ ul >
11
11
}
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ import {
25
25
26
26
import { DaffioDocList } from '../../models/doc-list' ;
27
27
28
+ const DEFAULT_ROUTER_LINK_ACTIVE_CONFIG : RouterLinkActive [ 'routerLinkActiveOptions' ] = {
29
+ exact : true ,
30
+ } ;
31
+
28
32
const visit = ( guide : DaffioDocList ) : DaffTreeData < unknown > => ( {
29
33
id : guide . id ,
30
34
title : guide . title ,
@@ -42,11 +46,14 @@ const visit = (guide: DaffioDocList): DaffTreeData<unknown> => ({
42
46
AsyncPipe ,
43
47
RouterLink ,
44
48
DaffTreeModule ,
49
+ RouterLinkActive ,
45
50
] ,
46
51
} )
47
52
export class DaffioDocsListComponent implements OnInit {
48
53
private _list$ = new BehaviorSubject < DaffioDocList > ( null ) ;
49
54
55
+ readonly ROUTER_LINK_ACTIVE_CONFIG = DEFAULT_ROUTER_LINK_ACTIVE_CONFIG ;
56
+
50
57
/**
51
58
* The guide list to render
52
59
*/
@@ -56,9 +63,6 @@ export class DaffioDocsListComponent implements OnInit {
56
63
}
57
64
58
65
tree$ : Observable < DaffTreeData < unknown > > ;
59
- activeRouterLinkConfiguration : RouterLinkActive [ 'routerLinkActiveOptions' ] = {
60
- exact : true ,
61
- } ;
62
66
63
67
ngOnInit ( ) : void {
64
68
this . tree$ = this . _list$ . pipe (
You can’t perform that action at this time.
0 commit comments