Skip to content

Commit

Permalink
button: fixed external links
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Apr 5, 2024
1 parent f6d8704 commit 11568e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions projects/feel/form/src/lib/button/button.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a *ngIf="link; else withoutLink"
[queryParams]="disabled ? undefined : query"
[routerLink]="disabled ? undefined : routerLink"
[href]="disabled ? undefined : href"
[routerLink]="disabled ? undefined : routerLink(link)"
[href]="disabled ? undefined : href(link)"
[routerLinkActive]="highlightActiveLink ? 'active' : []"
[class.highlight-active-link]="highlightActiveLink"
[class.center]="center !== false"
Expand Down
8 changes: 4 additions & 4 deletions projects/feel/form/src/lib/button/button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export class ButtonComponent {
@Input() public flavor?: ButtonFlavor;
@Input() @HostBinding("class.disabled") public disabled?: boolean | null;

get routerLink(): string | undefined {
return this.link && (this.link.startsWith('https:') || this.link.startsWith('mailto:')) ? undefined : this.link;
protected routerLink(link: string|undefined): string | undefined {
return link && (link.startsWith('https:') || link.startsWith('mailto:')) ? undefined : link;
}

get href(): string | undefined {
return this.link && (this.link.startsWith('https:') || this.link.startsWith('mailto:')) ? this.link : undefined;
protected href(link: string): string | undefined {
return link && (link.startsWith('https:') || link.startsWith('mailto:')) ? link : undefined;
}

@HostBinding("class.good")
Expand Down

0 comments on commit 11568e1

Please # to comment.