Angular 6 Sibling Routing (for a sidebar)Angular2 multiple router-outlet in the same templateAngular 2 - Submodule routing and nested <router-outlet>Angular 2 - named router-outlet routing in submoduleHow to inject routes to external angular moduleAngular 5 Multi level Child routes with Named router outletsAngular 5 child route getting loaded at root Level router-outlet when using loadchildren in routingAngular 5: Cannot match any routesAngular 2+ sliding sidebar outside router outletAngular 6: How can I route to both component & featureModule at the same time?Angular (6) Change secondary child route without changing parent primary outletHow to provide multiple router outlet in a template with same path?
Is there a standard name for this relation property : " aRb --> there is no c different from b such that aRc "?
Replacement stem cap and bolt
Is it legal to have an abortion in another state or abroad?
Why is the Eisenstein ideal paper so great?
Can we assume that a hash function with high collision resistance also means highly uniform distribution?
What does kpsewhich stand for?
Non-containing subsets of two sizes
Can my floppy disk still work without a shutter spring?
Why did it take so long for Germany to allow electric scooters / e-rollers on the roads?
Is there a context where the expression `a.b::c` makes sense?
Is it legal to meet with potential future employers in the UK, whilst visiting from the USA
How do I superimpose two math symbols?
Can I tell a prospective employee that everyone in the team is leaving?
I know that there is a preselected candidate for a position to be filled at my department. What should I do?
My players want to grind XP but we're using landmark advancement
Expected maximum number of unpaired socks
When playing Edgar Markov, what is the definition of a "Vampire spell"?
Can a character with the War Caster feat call a bolt with Call Lightning instead of making an opportunity attack?
Mercedes C180 (W204) dash symbol
Beginner looking to learn/master musical theory and instrumental ability. Where should I begin?
Which European Languages are not Indo-European?
Find this cartoon
What is the use case for non-breathable waterproof pants?
How to patch glass cuts in a bicycle tire?
Angular 6 Sibling Routing (for a sidebar)
Angular2 multiple router-outlet in the same templateAngular 2 - Submodule routing and nested <router-outlet>Angular 2 - named router-outlet routing in submoduleHow to inject routes to external angular moduleAngular 5 Multi level Child routes with Named router outletsAngular 5 child route getting loaded at root Level router-outlet when using loadchildren in routingAngular 5: Cannot match any routesAngular 2+ sliding sidebar outside router outletAngular 6: How can I route to both component & featureModule at the same time?Angular (6) Change secondary child route without changing parent primary outletHow to provide multiple router outlet in a template with same path?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying to implement routing functionality onto my Angular application, with partial success. Routing works on the main container of my application (the paths, without an outlet property).
The problem I am having is that I am trying to implement a second router outlet for a sidebar (paths with the outlet property called 'sidebar'). It isn't working.
The paths I have are as follows:
const appRoutes: Routes = [
path: '', component: WorkspaceAreaComponent , // localhost:4200/workspace
path: 'workspace', component: WorkspaceAreaComponent , // localhost:4200/workspace
path: 'reports', component: ReportsAreaComponent, children: [
path: '', component: ActiveProjectStatisticsComponent ,
path: 'active-project-stats', component: ActiveProjectStatisticsComponent ,
path: 'productivity-tracking', component: ProductivityTrackingComponent ,
] ,
path: 'templates', component: TemplatesAreaComponent, children: [
path: '', component: TemplateSectionsComponent ,
path: 'email', component: TemplateEmailComponent
] ,
path: '', component: TemplatesComponent, outlet: 'sidebar' ,
path: 'templates', component: TemplatesComponent, outlet: 'sidebar' ,
path: 'reports', component: ReportsComponent, outlet: 'sidebar'
];
The component for the main container looks as follows:
<div class="mainContainer">
<router-outlet></router-outlet>
</div>
The component for the sidebar looks as follows:
<div class="asideBox">
<router-outlet name="sidebar"></router-outlet>
</div>
The parent component template containing both of them is as follows:
<app-header></app-header>
<div class="bodyContainer">
<div *ngIf="!isOrganiserPage; else organiserPane" class="flexResponsive768">
<aside class="width20">
<!-- SIDEBAR COMPONENT -->
<app-sidebar></app-sidebar>
</aside>
<!-- MAIN COMPONENT -->
<main class="width80" app-main-pane>
</main>
</div>
<ng-template #organiserPane>
<main></main>
</ng-template>
</div>
<app-right-pane></app-right-pane>
<app-modals></app-modals>
Can somebody please help me with this issue? I've tried going on tutorials to solve this, but I haven't gotten much luck.
Thanks.
add a comment |
I am trying to implement routing functionality onto my Angular application, with partial success. Routing works on the main container of my application (the paths, without an outlet property).
The problem I am having is that I am trying to implement a second router outlet for a sidebar (paths with the outlet property called 'sidebar'). It isn't working.
The paths I have are as follows:
const appRoutes: Routes = [
path: '', component: WorkspaceAreaComponent , // localhost:4200/workspace
path: 'workspace', component: WorkspaceAreaComponent , // localhost:4200/workspace
path: 'reports', component: ReportsAreaComponent, children: [
path: '', component: ActiveProjectStatisticsComponent ,
path: 'active-project-stats', component: ActiveProjectStatisticsComponent ,
path: 'productivity-tracking', component: ProductivityTrackingComponent ,
] ,
path: 'templates', component: TemplatesAreaComponent, children: [
path: '', component: TemplateSectionsComponent ,
path: 'email', component: TemplateEmailComponent
] ,
path: '', component: TemplatesComponent, outlet: 'sidebar' ,
path: 'templates', component: TemplatesComponent, outlet: 'sidebar' ,
path: 'reports', component: ReportsComponent, outlet: 'sidebar'
];
The component for the main container looks as follows:
<div class="mainContainer">
<router-outlet></router-outlet>
</div>
The component for the sidebar looks as follows:
<div class="asideBox">
<router-outlet name="sidebar"></router-outlet>
</div>
The parent component template containing both of them is as follows:
<app-header></app-header>
<div class="bodyContainer">
<div *ngIf="!isOrganiserPage; else organiserPane" class="flexResponsive768">
<aside class="width20">
<!-- SIDEBAR COMPONENT -->
<app-sidebar></app-sidebar>
</aside>
<!-- MAIN COMPONENT -->
<main class="width80" app-main-pane>
</main>
</div>
<ng-template #organiserPane>
<main></main>
</ng-template>
</div>
<app-right-pane></app-right-pane>
<app-modals></app-modals>
Can somebody please help me with this issue? I've tried going on tutorials to solve this, but I haven't gotten much luck.
Thanks.
did you check stackoverflow.com/questions/34628848/…
– Akber Iqbal
Mar 24 at 3:03
add a comment |
I am trying to implement routing functionality onto my Angular application, with partial success. Routing works on the main container of my application (the paths, without an outlet property).
The problem I am having is that I am trying to implement a second router outlet for a sidebar (paths with the outlet property called 'sidebar'). It isn't working.
The paths I have are as follows:
const appRoutes: Routes = [
path: '', component: WorkspaceAreaComponent , // localhost:4200/workspace
path: 'workspace', component: WorkspaceAreaComponent , // localhost:4200/workspace
path: 'reports', component: ReportsAreaComponent, children: [
path: '', component: ActiveProjectStatisticsComponent ,
path: 'active-project-stats', component: ActiveProjectStatisticsComponent ,
path: 'productivity-tracking', component: ProductivityTrackingComponent ,
] ,
path: 'templates', component: TemplatesAreaComponent, children: [
path: '', component: TemplateSectionsComponent ,
path: 'email', component: TemplateEmailComponent
] ,
path: '', component: TemplatesComponent, outlet: 'sidebar' ,
path: 'templates', component: TemplatesComponent, outlet: 'sidebar' ,
path: 'reports', component: ReportsComponent, outlet: 'sidebar'
];
The component for the main container looks as follows:
<div class="mainContainer">
<router-outlet></router-outlet>
</div>
The component for the sidebar looks as follows:
<div class="asideBox">
<router-outlet name="sidebar"></router-outlet>
</div>
The parent component template containing both of them is as follows:
<app-header></app-header>
<div class="bodyContainer">
<div *ngIf="!isOrganiserPage; else organiserPane" class="flexResponsive768">
<aside class="width20">
<!-- SIDEBAR COMPONENT -->
<app-sidebar></app-sidebar>
</aside>
<!-- MAIN COMPONENT -->
<main class="width80" app-main-pane>
</main>
</div>
<ng-template #organiserPane>
<main></main>
</ng-template>
</div>
<app-right-pane></app-right-pane>
<app-modals></app-modals>
Can somebody please help me with this issue? I've tried going on tutorials to solve this, but I haven't gotten much luck.
Thanks.
I am trying to implement routing functionality onto my Angular application, with partial success. Routing works on the main container of my application (the paths, without an outlet property).
The problem I am having is that I am trying to implement a second router outlet for a sidebar (paths with the outlet property called 'sidebar'). It isn't working.
The paths I have are as follows:
const appRoutes: Routes = [
path: '', component: WorkspaceAreaComponent , // localhost:4200/workspace
path: 'workspace', component: WorkspaceAreaComponent , // localhost:4200/workspace
path: 'reports', component: ReportsAreaComponent, children: [
path: '', component: ActiveProjectStatisticsComponent ,
path: 'active-project-stats', component: ActiveProjectStatisticsComponent ,
path: 'productivity-tracking', component: ProductivityTrackingComponent ,
] ,
path: 'templates', component: TemplatesAreaComponent, children: [
path: '', component: TemplateSectionsComponent ,
path: 'email', component: TemplateEmailComponent
] ,
path: '', component: TemplatesComponent, outlet: 'sidebar' ,
path: 'templates', component: TemplatesComponent, outlet: 'sidebar' ,
path: 'reports', component: ReportsComponent, outlet: 'sidebar'
];
The component for the main container looks as follows:
<div class="mainContainer">
<router-outlet></router-outlet>
</div>
The component for the sidebar looks as follows:
<div class="asideBox">
<router-outlet name="sidebar"></router-outlet>
</div>
The parent component template containing both of them is as follows:
<app-header></app-header>
<div class="bodyContainer">
<div *ngIf="!isOrganiserPage; else organiserPane" class="flexResponsive768">
<aside class="width20">
<!-- SIDEBAR COMPONENT -->
<app-sidebar></app-sidebar>
</aside>
<!-- MAIN COMPONENT -->
<main class="width80" app-main-pane>
</main>
</div>
<ng-template #organiserPane>
<main></main>
</ng-template>
</div>
<app-right-pane></app-right-pane>
<app-modals></app-modals>
Can somebody please help me with this issue? I've tried going on tutorials to solve this, but I haven't gotten much luck.
Thanks.
asked Mar 24 at 0:22
Chosen1Chosen1
83211
83211
did you check stackoverflow.com/questions/34628848/…
– Akber Iqbal
Mar 24 at 3:03
add a comment |
did you check stackoverflow.com/questions/34628848/…
– Akber Iqbal
Mar 24 at 3:03
did you check stackoverflow.com/questions/34628848/…
– Akber Iqbal
Mar 24 at 3:03
did you check stackoverflow.com/questions/34628848/…
– Akber Iqbal
Mar 24 at 3:03
add a comment |
1 Answer
1
active
oldest
votes
I just found the answer to my own question.
The paths themselves were fine, it was the router link that needed changing.
I changed it from this:
<div class="mainMenu flex">
<a routerLink="organiser" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a routerLink="workspace" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a routerLink="reports" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a routerLink="templates" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
to this:
<div class="mainMenu flex">
<a [routerLink]="[ outlets: sidebar: ['organiser'] ]" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a [routerLink]="[ outlets: sidebar: ['workspace'] ]" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a [routerLink]="[ outlets: sidebar: ['reports'] ]" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a [routerLink]="[ outlets: sidebar: ['templates'] ]" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
And it all works fine. Thanks to nobody else but me for finding out the answer!
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55319624%2fangular-6-sibling-routing-for-a-sidebar%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I just found the answer to my own question.
The paths themselves were fine, it was the router link that needed changing.
I changed it from this:
<div class="mainMenu flex">
<a routerLink="organiser" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a routerLink="workspace" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a routerLink="reports" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a routerLink="templates" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
to this:
<div class="mainMenu flex">
<a [routerLink]="[ outlets: sidebar: ['organiser'] ]" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a [routerLink]="[ outlets: sidebar: ['workspace'] ]" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a [routerLink]="[ outlets: sidebar: ['reports'] ]" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a [routerLink]="[ outlets: sidebar: ['templates'] ]" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
And it all works fine. Thanks to nobody else but me for finding out the answer!
add a comment |
I just found the answer to my own question.
The paths themselves were fine, it was the router link that needed changing.
I changed it from this:
<div class="mainMenu flex">
<a routerLink="organiser" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a routerLink="workspace" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a routerLink="reports" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a routerLink="templates" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
to this:
<div class="mainMenu flex">
<a [routerLink]="[ outlets: sidebar: ['organiser'] ]" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a [routerLink]="[ outlets: sidebar: ['workspace'] ]" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a [routerLink]="[ outlets: sidebar: ['reports'] ]" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a [routerLink]="[ outlets: sidebar: ['templates'] ]" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
And it all works fine. Thanks to nobody else but me for finding out the answer!
add a comment |
I just found the answer to my own question.
The paths themselves were fine, it was the router link that needed changing.
I changed it from this:
<div class="mainMenu flex">
<a routerLink="organiser" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a routerLink="workspace" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a routerLink="reports" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a routerLink="templates" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
to this:
<div class="mainMenu flex">
<a [routerLink]="[ outlets: sidebar: ['organiser'] ]" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a [routerLink]="[ outlets: sidebar: ['workspace'] ]" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a [routerLink]="[ outlets: sidebar: ['reports'] ]" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a [routerLink]="[ outlets: sidebar: ['templates'] ]" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
And it all works fine. Thanks to nobody else but me for finding out the answer!
I just found the answer to my own question.
The paths themselves were fine, it was the router link that needed changing.
I changed it from this:
<div class="mainMenu flex">
<a routerLink="organiser" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a routerLink="workspace" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a routerLink="reports" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a routerLink="templates" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
to this:
<div class="mainMenu flex">
<a [routerLink]="[ outlets: sidebar: ['organiser'] ]" class="item" [ngClass]="organiserTabActive ? 'active' : ''" (click)="onClick(1)">ORGANISER</a>
<a [routerLink]="[ outlets: sidebar: ['workspace'] ]" class="item" [ngClass]="workspaceTabActive ? 'active' : ''" (click)="onClick(2)">WORKSPACE</a>
<a [routerLink]="[ outlets: sidebar: ['reports'] ]" class="item" [ngClass]="reportsTabActive ? 'active' : ''" (click)="onClick(3)">REPORTS</a>
<a [routerLink]="[ outlets: sidebar: ['templates'] ]" class="item" [ngClass]="templatesTabActive ? 'active' : ''" (click)="onClick(4)">TEMPLATES</a>
</div>
And it all works fine. Thanks to nobody else but me for finding out the answer!
answered Mar 24 at 13:30
Chosen1Chosen1
83211
83211
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55319624%2fangular-6-sibling-routing-for-a-sidebar%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
did you check stackoverflow.com/questions/34628848/…
– Akber Iqbal
Mar 24 at 3:03