Category "angular2-routing"

Lazy Loading, no chunks - Angular 7

I'm trying to do Lazy Loading, and followed the steps in the official docs of angular. The problem is that there is no chunks that is showing. Is there any ste

How to get the url segment within a CanActivate guard

I am using a guard to make sure users authenticate before reaching the page they request. A particular use case foresees that a user enters a url with some que

Angular 2: How to redirect route to child route with named outlet

I´m having a problem with Angular 2 router. I cannot get it to redirect to a specific child route with a named outlet. I think it´s a problem of URL

How to get current route custom data in angular 2?

I have set up routes is like below const appRoutes: Routes = [ { path: 'login', component: LoginComponent, data: { title: 'Login' } },

How to unit test a component that depends on parameters from ActivatedRoute?

I am unit testing a component that is used to edit an object. The object has an unique id that is used in order to grab the specific object from an array of obj

Template is not rendering in Angular2

I want to render html template by giving url in Angular2, But template is not loading. I am using visual studio code editor, Below is my code and structure.

Get current route without parameters

I need to get my current route without params in Angular 2, I found a way to get the current route with params as follows: this.router.url and then split it

How to determine previous page URL in Angular?

Suppose I am currently on the page which has the URL /user/:id . Now from this page I navigate to next page :id/posts. Now Is there a way, so that i can check

Different routes same component

I want to achieve something like this /products shows all the products and /products/:category shows all the products related to a specific category. To achieve

Navigate relative with Angular 2 Router (Version 3)

How to navigate relative from /questions/123/step1 to /questions/123/step2 within a component using Router without string concatenation and specifying /question

How to pass a parameter to routerLink that is somewhere inside the URL?

I know I can pass a parameter to routerLink for routes such as /user/:id by writing [routerLink]="['/user', user.id]" but what about routes such as this o

How to define default route with parameters in Angular Component Router?

I want to have a default route in my sub-component (set with useAsDefault: true) and to have parameters automatically passed to it. I cannot find anywhere in do