mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
Merge branch 'main' into w2p-87382_circular-dependency-fixes
This commit is contained in:
@@ -4,6 +4,7 @@ import { rendersMenuItemForType } from '../menu-item.decorator';
|
||||
import { isNotEmpty } from '../../empty.util';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { MenuItemType } from '../menu-item-type.model';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
/**
|
||||
* Component that renders a menu section of type LINK
|
||||
@@ -16,7 +17,10 @@ import { MenuItemType } from '../menu-item-type.model';
|
||||
export class LinkMenuItemComponent implements OnInit {
|
||||
item: LinkMenuItemModel;
|
||||
hasLink: boolean;
|
||||
constructor(@Inject('itemModelProvider') item: LinkMenuItemModel) {
|
||||
constructor(
|
||||
@Inject('itemModelProvider') item: LinkMenuItemModel,
|
||||
private router: Router,
|
||||
) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
@@ -31,4 +35,12 @@ export class LinkMenuItemComponent implements OnInit {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
navigate(event: any) {
|
||||
event.preventDefault();
|
||||
if (this.getRouterLink()) {
|
||||
this.router.navigate([this.getRouterLink()]);
|
||||
}
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user