make sure that the dynamically populated text boxes (with content from NHS) correctly opens links in external windows.

This commit is contained in:
Jason Kulatunga 2023-09-06 18:49:37 -07:00
parent 80d3f680a5
commit bf03a987f3
2 changed files with 2 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<div *ngIf="!loading else isLoadingTemplate">
<div [innerHTML]="description"></div>
<div [innerHTML]="description" externalLink></div>
<p>Source: <a [href]="url" externalLink>{{source}}</a></p>
</div>

View File

@ -37,10 +37,9 @@ export class ExternalLinkDirective {
onClick(event: MouseEvent) {
event.preventDefault();
let url: string = (<any>event.currentTarget).getAttribute("href");
let url: string = (<any>event.currentTarget).getAttribute("href") || (<any>event.target).getAttribute("href");
//check if wails exists and is defined
if(typeof wails !== "undefined" && environment.environment_desktop){
wails.CallByName("pkg.AppService.BrowserOpenURL", url)
} else{