-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
igxTabs and igxBottomNav should support router outlet #4297
Comments
I actually noticed that the |
@kdinev Could you share your solution with my router outlet is on app.component.html (regular router implementation): from infragistics documentation example <igx-tabs>
<igx-tabs-group *ngFor="let val of routerLinks">
<ng-template igxTab>
{{routerLink.label}}
<a routerLink="{{routerLink.link}}"></a>
</ng-template>
</igx-tabs-group>
</igx-tabs>
<router-outlet></router-outlet> on the app.component.html I have (inside the constructor): this.routerLinks = [
{
index: 0,
label: ops,
link: '/ops',
},
{
index: 1,
label: 'pods',
link: '/pods',
},
{
index: 2,
label: 'pads',
link: '/pads',
},
]; The above doesnt work, I thought it was my router implementation but If do: <ul>
<li>
<a [routerLink]="['/ops']" routerLinkActive="active">ops</a>
</li>
<li>
<a [routerLink]="['/pods']" routerLinkActive="active">pods</a>
</li>
<li>
<a [routerLink]="['/pads']" routerLinkActive="active">pads</a>
</li>
</ul>
<router-outlet></router-outlet> works perfectly. (which just makes think I can use regular buttons or navbar really), but I like the effect of igx-tabs How do it get the same using igx-tabs?...it seems |
@corganfuzz, @kdinev We have a sample how to implement routing with igxTab: |
@bkulov Thanks, that worked |
Here is a possible solution on how to load router links for IgxBottonNav control:
|
Interesting. I couldnt make it to work with routerLink and ng-template. I’ve used the second example in the documentation with the switch statement i believe |
Is your feature request related to a problem? Please describe.
When using an
IgxTabs
component orIgxBottomNav
component, I want to load the content in the tabs according to the route that the user has gone to. Right now I can only have my components inside the tabs and bottom nav content and they are all loaded with the top-level component.E.g. with tabs:
E.g. with bottom nav:
Describe the solution you'd like
I would like the configuration to be something similar to:
E.g. tabs:
E.g. bottom-nav:
Describe alternatives you've considered
The only way to do this currently is to have all my routes with arguments going to one component, which handling of the selected index based on the routing param. This would still load all the components together with the top-level component.
Additional context
The current implementation is not very developer friendly.
The text was updated successfully, but these errors were encountered: