Skip to content

Commit ece0d95

Browse files
authored
feat: add option to open link in new tab (#1019)
* feat: add option to open link in new tab * style: prettier
1 parent 35389a1 commit ece0d95

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

projects/components/src/link/link.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { EMPTY, Observable } from 'rxjs';
1212
<a
1313
*htLetAsync="this.navData$ as navData"
1414
class="ht-link"
15+
target="{{ this.openInNewTab ? '_blank' : '' }}"
16+
rel="noopener noreferrer"
1517
[ngClass]="{ disabled: this.disabled || !navData }"
1618
[routerLink]="navData?.path"
1719
[queryParams]="navData?.extras?.queryParams"
@@ -27,6 +29,9 @@ export class LinkComponent implements OnChanges {
2729
@Input()
2830
public paramsOrUrl?: NavigationParams | string | null;
2931

32+
@Input()
33+
public openInNewTab?: boolean;
34+
3035
@Input()
3136
public disabled?: boolean;
3237

0 commit comments

Comments
 (0)