angular-ui-router

How to activate RouteReuseStrategy only for specific routes

∥☆過路亽.° 提交于 2020-12-29 03:05:23
问题 Is there a way to implement RouteReuseStrategy only for specific routes? Meaning each route with children, getting its own custom implementation of RouteReuseStrategy , and whose methods only fire when a route in a specific 'tree' is activated. I currently use the code from this answer, but I want to expand it with the above logic if possible. 回答1: Create a custom route reuse strategy import { RouteReuseStrategy, ActivatedRouteSnapshot, DetachedRouteHandle } from "@angular/router"; export

angular 7 getting ActivatedRoute params not working

末鹿安然 提交于 2020-08-24 07:42:28
问题 Hi and thank you for your help in advance. I have been working on this problem for awhile now and have not been able to figure it out yet. What I want to do is to access the params and display what is selected on the page. It doesn't fire when the routerLink is clicked. so I have the following: question on stackblitz I can't seem to get it to work. layout.component.ts import { Component, OnInit} from '@angular/core'; import { ActivatedRoute, Router} from '@angular/router'; @Component({

angular 7 getting ActivatedRoute params not working

吃可爱长大的小学妹 提交于 2020-08-24 07:41:45
问题 Hi and thank you for your help in advance. I have been working on this problem for awhile now and have not been able to figure it out yet. What I want to do is to access the params and display what is selected on the page. It doesn't fire when the routerLink is clicked. so I have the following: question on stackblitz I can't seem to get it to work. layout.component.ts import { Component, OnInit} from '@angular/core'; import { ActivatedRoute, Router} from '@angular/router'; @Component({

Angular 4 403 Forbidden on route parameter with IIS

流过昼夜 提交于 2020-06-26 19:47:43
问题 I deployed my Angular project to our dev environment using IIS Version 6.1 SP1 and I'm getting 403 Forbidden error on my route parameter. In my URL, the "client" is not a component but a route parameter. The project works perfectly fine on my localhost, the issue is only when I pushed the code to our development environment. Here is my code in app.routes.ts: const routes: Routes = [ { path: '', redirectTo: 'login', pathMatch: 'full' }, { path: 'login', component: LoginComponent }, { path:

Angular 4 403 Forbidden on route parameter with IIS

时光毁灭记忆、已成空白 提交于 2020-06-26 19:44:45
问题 I deployed my Angular project to our dev environment using IIS Version 6.1 SP1 and I'm getting 403 Forbidden error on my route parameter. In my URL, the "client" is not a component but a route parameter. The project works perfectly fine on my localhost, the issue is only when I pushed the code to our development environment. Here is my code in app.routes.ts: const routes: Routes = [ { path: '', redirectTo: 'login', pathMatch: 'full' }, { path: 'login', component: LoginComponent }, { path: