Questions tagged [angular2-router]
119 questions
7
votes
3 answers
How to handle multiple queryParams in Angular2
I'm trying to implement a filtering mechanism in a new Angular2 app, that would allow me to filter a list of entries in an array. The entries may have around 20 properties that could be filtered on. I have so far created a list of filters in one…

Tony Jackson
- 135
- 1
- 1
- 6
7
votes
4 answers
Cannot match any routes with child routes and new angular 2 RC1 router
ApplicationComponent
import { Component } from '@angular/core';
import {Router, ROUTER_DIRECTIVES, Routes, ROUTER_PROVIDERS} from '@angular/router';
import {SchoolyearsComponent} from "./schoolyear/schoolyears.component";
@Component({
directives:…

Pascal
- 12,265
- 25
- 103
- 195
6
votes
0 answers
Get current named outlet from url
I have a route that looks like this :
/dashboard/55612291A38AB9CB1C8FE7FB7A166E63/(report//right:logs)
which means I have a DashboardComponent, in which I open a ReportComponent inside the primary outlet. In my DashboardComponent, I also have a…

Gnujeremie
- 570
- 3
- 17
6
votes
1 answer
Disable application loading/routing in Angular2
I have an angular2 application (RC6 version), where some important global parameters are loaded from a configuration file using a service that collects this file on startup:
@NgModule({
imports: [ BrowserModule, FormsModule, HttpModule, AppRoutes,…

billias
- 775
- 7
- 17
6
votes
2 answers
No compatible version found: @angular/router@^2.0.0-rc.4 error while installing angular2 RC4 router
I have package.json dependencies as follows:
"dependencies": {
"@angular/common": "^2.0.0-rc.4",
"@angular/compiler": "^2.0.0-rc.4",
"@angular/core": "^2.0.0-rc.4",
"@angular/http": "^2.0.0-rc.4",
"@angular/platform-browser":…

Akhilesh Kumar
- 9,085
- 13
- 57
- 95
6
votes
4 answers
Angular 2 rc3 router-deprecated package issue
Welcome Angular 2 rc.3!
I use project.json from 5 Min Quickstart to configure my project, but when i run npm install i get follow error:
No compatible version found: @angular/router-deprecated@2.0.0-rc.3
Valid install targets:
2.0.0-rc.2,…

user3272018
- 2,309
- 5
- 26
- 48
5
votes
1 answer
Angular2: what is difference between resolve and data in routing paths?
I see that are 2 ways to pass simple data, such as strings, to different components from routing paths:
First way:
Routing side:
export const AppRoutes: Routes = [
...
{
path: '/one', component: OneComponent, resolve: { foo: 'foo' }
…

smartmouse
- 13,912
- 34
- 100
- 166
4
votes
1 answer
How to test routerLink inside button tag angular2
Button looks like this
I want to check if url has redirected to /account/recovery/identification after the button is clicked
If it was an anchor tag…

Amit Chigadani
- 28,482
- 13
- 80
- 98
4
votes
5 answers
Using regex for path value of routes in angular2
I want to configure route for my angular2 application. My URL needs to be like this:
http://domain_name/constant_value/variable_value/constant_value
The url can be like following…

kanra-san
- 469
- 6
- 9
- 21
4
votes
2 answers
Angular2 Route Access denied logic
I'm trying to put access checks for routes and display access denied page instead of actual page. From the example below we can alert access denied on route click . I would prefer to navigate to the actual page and then show Access…

tomalex
- 1,233
- 6
- 17
- 40
4
votes
2 answers
Anyone experience slow loading times with angular2
I have an angular two app with typescript and systemjs.
My apps only 800kb and takes 4 seconds to long a page with text only.
All my js and css is small / minified and I have 11 requests in total with hardly any images
All images are compressed and…

AngularM
- 15,982
- 28
- 94
- 169
4
votes
1 answer
Angular2: Routing to the same page and changing query parameters
I have an Angular 2 project where I want to do the following:
Lets say I have a Component which has a datatable that supports paging and sorting.
What I want to achieve is that every time the table page/size and sorting changes, to also change the…

ChrisGeo
- 3,807
- 13
- 54
- 92
4
votes
3 answers
Angular 2 routing without navbar
Every topic on Angular2 routing has a fixed navbar
So basically when clicked on the…

Sfen
- 136
- 8
4
votes
2 answers
Angular 2 login page that has different design from other pages
My main design is in app.component.html as normally. Other components use this one like master page. But how login page will have a different design. Normally it's a component like others and (must?) work in in app.component.html.
I can't figure it…

Crypto
- 157
- 12
4
votes
1 answer
Use routerlink or href based on condition
I have this piece of code in a component
...
This works as expected when is using local routes that are defined in the app.component but when external routes it redirects to…

Andrés Guibarra
- 43
- 1
- 3