File tree Expand file tree Collapse file tree 7 files changed +43
-7
lines changed Expand file tree Collapse file tree 7 files changed +43
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
5
5
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
6
6
7
- ## [ 1.0.0] - 2023-11-14
7
+ ## [ 1.0.1] - 2023-12-13
8
+ ### Fixed
9
+ - Router link blank and router link
10
+
11
+ ## [ 1.0.0] - 2023-12-13
8
12
### Added
9
13
- Init project
10
14
- Prototype
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import {MatDatepickerModule} from "@angular/material/datepicker";
45
45
import { MatNativeDateModule } from "@angular/material/core" ;
46
46
import { MatFormFieldModule } from "@angular/material/form-field" ;
47
47
import { MatButtonToggleModule } from "@angular/material/button-toggle" ;
48
+ import { ExternalLinkBlankDirective } from "./external-link-blank.directive" ;
48
49
49
50
@NgModule ( {
50
51
declarations : [
@@ -53,6 +54,7 @@ import {MatButtonToggleModule} from "@angular/material/button-toggle";
53
54
SidebarComponent ,
54
55
TeilerAppPluginOrchestratorComponent ,
55
56
ExternalLinkDirective ,
57
+ ExternalLinkBlankDirective ,
56
58
TeilerBoxComponent ,
57
59
TeilerWelcomeComponent
58
60
] ,
Original file line number Diff line number Diff line change
1
+ import { ExternalLinkBlankDirective } from './external-link-blank.directive' ;
2
+
3
+ describe ( 'ExternalLinkBlankDirective' , ( ) => {
4
+ it ( 'should create an instance' , ( ) => {
5
+ //TODO
6
+ //const directive = new ExternalLinkBlankDirective();
7
+ //expect(directive).toBeTruthy();
8
+ } ) ;
9
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { Directive , Input } from '@angular/core' ;
2
+ import { RouterLink } from "@angular/router" ;
3
+
4
+ @Directive ( {
5
+ selector : '[externalLinkBlank]'
6
+ } )
7
+ export class ExternalLinkBlankDirective {
8
+
9
+ @Input ( 'externalLinkBlank' ) externalLink : string = '' ;
10
+
11
+ constructor ( private routerLinkWithHref : RouterLink ) {
12
+ routerLinkWithHref . onClick = ( ) => {
13
+ if ( this . externalLink != null && this . externalLink != undefined && this . externalLink . length > 0 ) {
14
+ window . open ( this . externalLink , '_blank' ) ;
15
+ return false ;
16
+ }
17
+ return true ;
18
+ } ;
19
+ }
20
+
21
+
22
+ }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export class ExternalLinkDirective {
11
11
constructor ( private routerLinkWithHref : RouterLink ) {
12
12
routerLinkWithHref . onClick = ( ) => {
13
13
if ( this . externalLink != null && this . externalLink != undefined && this . externalLink . length > 0 ) {
14
- window . open ( this . externalLink , '_blank' ) ;
14
+ window . location . href = this . externalLink ;
15
15
return false ;
16
16
}
17
17
return true ;
Original file line number Diff line number Diff line change 50
50
</ div >
51
51
</ ng-template >
52
52
< a mat-list-item routerLink ="{{'/'+teilerApp.routerLink}} "
53
- [externalLink ] ="teilerApp.sourceUrl??'' " class ="sidebar-text "> {{teilerApp.title}}</ a >
53
+ [externalLinkBlank ] ="teilerApp.sourceUrl??'' " class ="sidebar-text "> {{teilerApp.title}}</ a >
54
54
</ div >
55
55
</ div >
56
56
</ div >
593
593
</ div >
594
594
</ div >
595
595
</ div >
596
-
Original file line number Diff line number Diff line change 28
28
</ a >
29
29
</ div >
30
30
< div *ngIf ="teilerApp.externLink ">
31
- < a routerLink ="{{'/'+teilerApp.routerLink}} " [externalLink ] ="teilerApp.sourceUrl??'' ">
31
+ < a routerLink ="{{'/'+teilerApp.routerLink}} " [externalLinkBlank ] ="teilerApp.sourceUrl??'' ">
32
32
< teiler-box [teilerApp] ="teilerApp "> </ teiler-box >
33
33
</ a >
34
34
</ div >
48
48
</ a >
49
49
</ div >
50
50
< div *ngIf ="teilerApp.externLink ">
51
- < a routerLink ="{{'/'+teilerApp.routerLink}} " [externalLink ] ="teilerApp.sourceUrl??'' ">
51
+ < a routerLink ="{{'/'+teilerApp.routerLink}} " [externalLinkBlank ] ="teilerApp.sourceUrl??'' ">
52
52
< teiler-box [teilerApp] ="teilerApp "> </ teiler-box >
53
53
</ a >
54
54
</ div >
@@ -75,7 +75,7 @@ <h3 i18n>Lokale Apps</h3>
75
75
</ a >
76
76
</ div >
77
77
< div *ngIf ="teilerApp.externLink ">
78
- < a routerLink ="{{'/'+teilerApp.routerLink}} " [externalLink ] ="teilerApp.sourceUrl??'' ">
78
+ < a routerLink ="{{'/'+teilerApp.routerLink}} " [externalLinkBlank ] ="teilerApp.sourceUrl??'' ">
79
79
< teiler-box [teilerApp] ="teilerApp "> </ teiler-box >
80
80
</ a >
81
81
</ div >
You can’t perform that action at this time.
0 commit comments