The simplest way would be to use *ngIf / else
:
External
Internal
EDIT#1: (Ugly workaround)
Since you don't want to use *ngIf
(I still don't understand why), you can do this:
Template:
Link
Component:
handleClick(outside: boolean, internalUrl: string, internalId: string, externalUrl: string): void {
if (outside) {
window.location.href = externalUrl;
// You can also use Location class of Angular
} else {
this.router.navigate([`${internalUrl}/${internalId}`]);
}
}