Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions projects/components/src/link/link.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { EMPTY, Observable } from 'rxjs';
<a
*htLetAsync="this.navData$ as navData"
class="ht-link"
target="{{ this.openInNewTab ? '_blank' : '' }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how's this differ from the existing way of doing this?

This component takes an ExternalNavigationParams as an input, which includes window handling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I thought it suspicious that we didn't have this already. I though that might be how, but it didn't seem to work when I was playing with it. I'll circle back and try again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExternalNavigationParams option should support this.

rel="noopener noreferrer"
[ngClass]="{ disabled: this.disabled || !navData }"
[routerLink]="navData?.path"
[queryParams]="navData?.extras?.queryParams"
Expand All @@ -27,6 +29,9 @@ export class LinkComponent implements OnChanges {
@Input()
public paramsOrUrl?: NavigationParams | string | null;

@Input()
public openInNewTab?: boolean;

@Input()
public disabled?: boolean;

Expand Down