diff --git a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts index 5b18335d8c..2066877476 100644 --- a/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts +++ b/packages/sitecore-jss-angular/src/components/router-link.directive.spec.ts @@ -115,6 +115,7 @@ describe('', () => { fixture.detectChanges(); const rendered = de.query(By.css('a')); + expect(rendered.nativeElement.href).toContain(field.value.href); expect(rendered.nativeElement.className).toContain(field.value.class); expect(rendered.nativeElement.title).toContain(field.value.title); expect(rendered.nativeElement.target).toContain(field.value.target); diff --git a/packages/sitecore-jss-angular/src/components/router-link.directive.ts b/packages/sitecore-jss-angular/src/components/router-link.directive.ts index 30a50326ac..5cb4f3651c 100644 --- a/packages/sitecore-jss-angular/src/components/router-link.directive.ts +++ b/packages/sitecore-jss-angular/src/components/router-link.directive.ts @@ -34,7 +34,7 @@ export class RouterLinkDirective extends LinkDirective { if (key === 'href') { this.renderer.listen(node, 'click', (event) => { - this.router.navigate([propValue]); + this.router.navigateByUrl(propValue); event.preventDefault(); }); }