1

We have an application now running in angular2+. we recently started to use AOT ,since then we are seeing a strange behaviour. if we click on any link with routing (child routes) it will open a new tab for once, if we keep the newly opened tab then from next click onwards route changes will be reflected on that new tab only. if we close the newly opened tab, on next click of any route link it will again open a new tab. in short now it basically operates on 2 tabs. what could be the possible reason.?? i hope my question is clear. Thanks in advance.

This is how we have specified routes in links.

<li ><a data-toggle="collapse" data-target=".navbar-collapse"> [routerLink]="['XYZ1']">XYZ1</a></li>
<li ><a data-toggle="collapse" data-target=".navbar-collapse"  [routerLink]="['XYZ2']">XYZ2</a></li>
<li ><a data-toggle="collapse" data-target=".navbar-collapse"  [routerLink]="['XYZ3']">XYZ3</a></li>
Amarnath R Shenoy
  • 5,121
  • 8
  • 24
  • 32

1 Answers1

1

issue was with the anchor tag

I removed data-toggle="collapse" data-target=".navbar-collapse" from my anchor tag and made it look like

<li ><a> [routerLink]="['XYZ1']">XYZ1</a></li>

it worked, i dont know what was the issue, posting this here so that it may help some one.

Amarnath R Shenoy
  • 5,121
  • 8
  • 24
  • 32