Skip to content

Commit 4b82dda

Browse files
committed
make config a constant
1 parent 95306d6 commit 4b82dda

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Diff for: apps/daffio/src/app/docs/components/docs-list/docs-list.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</ng-template>
66

77
<ng-template #daffTreeItemTpl let-node>
8-
<a [daffTreeItem]="activeRouterLinkConfiguration" [node]="node" [routerLink]="node.url">{{ node.title }}</a>
8+
<a [daffTreeItem]="ROUTER_LINK_ACTIVE_CONFIG" [node]="node" [routerLink]="node.url">{{ node.title }}</a>
99
</ng-template>
1010
</ul>
1111
}

Diff for: apps/daffio/src/app/docs/components/docs-list/docs-list.component.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ import {
2525

2626
import { DaffioDocList } from '../../models/doc-list';
2727

28+
const DEFAULT_ROUTER_LINK_ACTIVE_CONFIG: RouterLinkActive['routerLinkActiveOptions'] = {
29+
exact: true,
30+
};
31+
2832
const visit = (guide: DaffioDocList): DaffTreeData<unknown> => ({
2933
id: guide.id,
3034
title: guide.title,
@@ -47,6 +51,8 @@ const visit = (guide: DaffioDocList): DaffTreeData<unknown> => ({
4751
export class DaffioDocsListComponent implements OnInit {
4852
private _list$ = new BehaviorSubject<DaffioDocList>(null);
4953

54+
readonly ROUTER_LINK_ACTIVE_CONFIG = DEFAULT_ROUTER_LINK_ACTIVE_CONFIG;
55+
5056
/**
5157
* The guide list to render
5258
*/
@@ -56,9 +62,6 @@ export class DaffioDocsListComponent implements OnInit {
5662
}
5763

5864
tree$: Observable<DaffTreeData<unknown>>;
59-
readonly activeRouterLinkConfiguration: RouterLinkActive['routerLinkActiveOptions'] = {
60-
exact: true,
61-
};
6265

6366
ngOnInit(): void {
6467
this.tree$ = this._list$.pipe(

0 commit comments

Comments
 (0)