javascript - Issue while updating the path param in angular 8 at production build
问题描述
I am working on the angular 8 app, implemented the routing. in the app one of the component is used to show the list of products(like list of mails) and and another component is used to show the details (like gmail) based on the selection, while selecting the product form a list, I am updating the URL path parameter (changing the product id) so user can save the URL for later use.
here is the routing config.
{
path: 'product/:id',
runGuardsAndResolvers: () => false,
pathMatch:'full',
children: [
{
path: '',
runGuardsAndResolvers:() => false,
pathMatch:'full',
component: ProductDetailComponent,
outlet: 'renderView'
}]
},
and for first navigation I am using the simple anchor tag
<a class="dropdown-item " [routerLink]="['/product',selectedEntityId]" routerLinkActive="active"
[routerLinkActiveOptions]="{ exact: true }">Products</a>
from product listing component, I am using the following tag
<a href="javascript:void(0)" style="cursor: pointer;" (click)="OnSelect(product)" [routerLink]="['../',product.product_id]" *ngFor="let entity of prodcutResults" class="list-group-item list-group-item-action"> {{product.name}}</a>
in the development build its working perfectly fine, but when I try to generate the production build compilation failed due to this expresssion
runGuardsAndResolvers: () => false,
I tried to use other options from Resolver (always|pathParamChange...) but using these configuration parameter does not change
I tried to change this expression into exported function as well
export function predicate(): RunGuardsAndResolvers {
return (from: ActivatedRouteSnapshot, to: ActivatedRouteSnapshot)=>false;
}
but it is not working, anyone having idea about this issue or any alternative approach or suggestion
解决方案
推荐阅读
- ruby-on-rails - 生产中的 Rails 5 自动加载问题
- linux - Flutter Doctor 显示在 Doctor 上运行的 CentOS Linux 7 的 GTK 3.0 存在问题
- android - 使用相机的Android应用程序时不时崩溃
- python - Pyspark 将数据帧写入 csv 文件会出错
- informatica - Informatica Cloud 增量负载
- ios - iOS - 在 tableView 重新加载时执行动画
- r - 无法加载拨浪鼓。每次它显示 R 会话中止,致命错误(附截图) - Mac BigSur
- android - 如何根据用户选择从房间数据库中获取和显示特定结果(android studio)
- jenkins - Jenkins 错误:“未知阶段部分“阶段”。从版本 0.5 开始,阶段中的步骤必须位于“步骤”块中
- c++ - 在 STARTLS 之后我应该发送什么?