当我尝试将值从一台服务器传递到另一台服务器时,我收到错误消息“访问 XMLHttpRequest at ' http://localhost:8082/kanchiwork/ ' from origin ' http://localhost:4200 ' 已被 CORS 策略阻止”。 我的 .ts ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
我正在制定这样的路由规则。
{ path: 'index', component: IndexComponent
, children:
[
{ path: '', redirectTo:'profile',pathMatch:'full'},
{ path: 'profile', outlet: "inner", component: ProfileComponent },
// some other rules
]
}
在这里,我使用两个路由器插座,主要和内部。 在 IndexComponent.html 内部存在内部出口。 当我在 URL 使用http://localhost:4200/index时,只有主路由器插座有效,内部没有更新。 我的期望是在内部路由器出口中显示 ProfileComponent 或在主路由器出口中使用 IndexComponent 将 /index 规则重定向到 /index/orders/(inner:profile) 。
尝试这个。
{ path: '', redirectTo:'/(inner:profile)',pathMatch:'full'}
但是如果你的根路径是空的或者使用延迟加载的模块,你可以按照这个 PR( angular/pull/25483 )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.