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…
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…
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…
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 }
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…
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…
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,…
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…
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…
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…
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,…
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, …
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: …
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…
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: '', …
vangoo
  • 91
  • 12