Route to specific tab using anchor in ng-bootstrap

Viewed 568

I am trying to create a link which opens a tab from ng-bootstrap.

The tab has a specific id and I am creating the link as follows:

 [routerLink]="['/path/', i.name]" fragment="anchorid"

The url is created correctly but the tab is not opened. It always shows the first tab on the page.

I am using hash navigation with Angular 4.

1 Answers

Make sure you are using router outlet to view the next tab.

<router-outlet></router-outlet>
Related