Questions tagged [angular2-router3]
90 questions
3
votes
2 answers
Why is routerLinkActive not firing if routerLink has a binding?
In my app there is more than one way to route to a particular resource, for example, I got breadcrumbs in order to be able to navigate more freely through a hierarchy of items
SectionA > SectionB > SectionC
where SectionA has id=1 and so on. At the…
![](../../users/profiles/370935.webp)
Thorsten Westheider
- 9,252
- 12
- 51
- 92
2
votes
2 answers
Angular router - how to share parent route across multiple routing modules
I created my Angular app with Angular CLI but now I have a problem with router. The app I want to build has some pages that have header and footer but also some pages that don't, like login page for example. So I need a way to share the layout with…
![](../../users/profiles/3384343.webp)
jbojcic
- 837
- 1
- 10
- 23
2
votes
2 answers
How is routing with nested modules supposed to work in Angular 2?
I can't for the love of cookies figure out how to configure the most recent incarnation of the Angular 2 router (the one from the final release). I have a rather large Angular 2 RC5 app up and running, but need to migrate to the final release now…
![](../../users/profiles/370935.webp)
Thorsten Westheider
- 9,252
- 12
- 51
- 92
2
votes
2 answers
Error: No component factory found for TermsConditions
I am getting this Error:
No component factory found for TermsConditions while using angular2-rc6.
My route map is like this:
{
path: '',
component: TermsConditions
}
![](../../users/profiles/1033171.webp)
Ashutosh Singh
- 656
- 1
- 7
- 19
2
votes
0 answers
Change route parameters without affecting subroutes
I have a route /a with some parameters (such as /a;foo=1;bar=2/) and two sub-routes: /a/x and a/y.
Component responsible for route a fiddles with parameters foo and bar and changes them depending on the user input. It also updates the parameters in…
![](../../users/profiles/2131286.webp)
Lazar Ljubenović
- 15,745
- 7
- 45
- 80
2
votes
2 answers
Angular2 RC5 router 3.0.0 - no href in in component from shared library
I have problem with generated routing link in component from shared module.
Here is the plunker.
There are 3 links in navigation menu. When I click on "Information" the page shows correctly and there should be link to Health. But Angular does not…
![](../../users/profiles/905865.webp)
koral
- 2,359
- 3
- 29
- 52
2
votes
1 answer
How to specify auxiliary component for child route in angular2 router3
I am using the new route3 and would like to know what is the URL syntax to specify a auxiliary component for a child route.
I have following child route definition:
const router: RouterConfig = [
{
path: 'component-c', component: ComponentC,…
![](../../users/profiles/3121397.webp)
Yuan Li
- 195
- 1
- 2
- 7
2
votes
1 answer
For Angular2 Router3, why isn't my Parent Route's Guard called every time I switch between its child routes?
I have a Guard for my parent route that isn't always called when viewing the child routes. It is called when the first child is loaded, but if I switch to another child within the same parent, the parent's Guard isn't referenced again. Here's what I…
![](../../users/profiles/3229501.webp)
SnoopDougg
- 1,117
- 1
- 16
- 29
2
votes
1 answer
What does a valid [routerLink] look like for a relative aux route?
Let's say I got this route config:
{ path: 'contact', component: ContactComponent, children: [
{ path: ':id', component: ContactDetailComponent },
{ path: 'chat', component: ContactChatComponent, outlet: 'chat' }
]}
If I navigate…
![](../../users/profiles/370935.webp)
Thorsten Westheider
- 9,252
- 12
- 51
- 92
2
votes
2 answers
LoggedInOutlet angular2 authentication - Router v3.0.0-alpha8 - Where is ComponentInstruction?
I am using code like this to extend RouterOutlet and create app wide authentication and route protection
import {Directive, Attribute, ViewContainerRef, DynamicComponentLoader} from '@angular/core';
import {Router, ComponentInstruction} from…
![](../../users/profiles/5376813.webp)
TetraDev
- 12,675
- 2
- 48
- 54
2
votes
3 answers
Angular2 component doesn't detect routing parameter updates (Router 3.0)
I've got a small Plunk I'm using for playing around with the new Router 3.0 alpha currently available in Angular 2. It works well in general, but the issue is that once I click on a link that routes to the 'detail' component with a particular ID,…
![](../../users/profiles/1480995.webp)
Michael Oryl
- 18,335
- 14
- 68
- 107
1
vote
1 answer
how can i get variable from parent Component in the child component in angular 2?
this is Routing.ts
{
path: 'adminHome',
component: adminHomeComponent,
children: [
{
path: 'users',
component: UserListComponent,
children: [
{
path: ':id',
component: EntrepriseListComponent,
…
![](../../users/profiles/6719684.webp)
o.O
- 125
- 4
- 13
1
vote
1 answer
angular2 and routing - adding a query parm to child
Wow
this.router.navigate(['/services', {outlets: {'servicelistright': ['servicelist']}}]);
If I the below to the url I get get the query parm using the below:
…
![](../../users/profiles/1203556.webp)
Tampa
- 62,379
- 105
- 250
- 388
1
vote
2 answers
Angular2: how to retrieve path array from Router?
Do you know that if you want to go to another page you can use the following code?
this.router.navigate(['section1', 'section1-children', 'my-page']);
Here, as you know, every string in the array is a path declared in the routing file of the module…
![](../../users/profiles/2516399.webp)
smartmouse
- 11,808
- 26
- 77
- 154
1
vote
1 answer
Angular2 Authguard route to login
if user who don't login, want to go some secure root for example "/items" authguard return false and dont navigate "/login".
export const APP_ROUTES: Routes = [
{path: '', component: PublicComponent, children: PUBLIC_ROUTES},
{
path: '',
…
![](../../users/profiles/7046389.webp)
vangoo
- 91
- 12