Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 使用角度路由器在角度SPA之间导航_Angular_Angular Routing_Angular Router - Fatal编程技术网

Angular 使用角度路由器在角度SPA之间导航

Angular 使用角度路由器在角度SPA之间导航,angular,angular-routing,angular-router,Angular,Angular Routing,Angular Router,我必须为每种产品类型建立多个角度SPA。我将有一个通用的angular应用程序,从这个应用程序中我有一个名为Product Type的链接 当用户单击此链接时,我必须导航到为该产品创建的相应SPA。我不想使用服务器后端来实现此重定向 每个水疗中心将在其自己的港口运行。 REST服务器后端将在完全不同的服务器上运行 请告知是否有任何选项可以使用客户端路由实现此功能 在下面的示例中,url重定向应该发生在ProductTypeComponent内部 我的路线文件 const appRoutes: R

我必须为每种产品类型建立多个角度SPA。我将有一个通用的angular应用程序,从这个应用程序中我有一个名为Product Type的链接

当用户单击此链接时,我必须导航到为该产品创建的相应SPA。我不想使用服务器后端来实现此重定向

每个水疗中心将在其自己的港口运行。 REST服务器后端将在完全不同的服务器上运行

请告知是否有任何选项可以使用客户端路由实现此功能

在下面的示例中,url重定向应该发生在ProductTypeComponent内部

我的路线文件

const appRoutes: Routes = [
{ path: 'callback', component: CallbackComponent },
{ path: 'home', component: HomeComponent, canActivate: [ AuthGuardService ] 
},
{path: 'productType', component: ProductTypeComponent, canActivate: [ 
AuthGuardService ]},
{ path: '**', component: PagenotfoundComponent }
];

客户端路由用于应用程序内导航。您不能使用它导航到其他SPA


使用带有
href
属性的简单锚定标记链接到单独的应用程序。

我想根据特定条件从通用应用程序重定向到不同的SPA应用程序(通用应用程序在localhost端口3000中运行)。我尝试从通用应用程序中使用router.navigateByUrl(),并提供了SPA app1的完整路径(SPA app1在localhost 4200中运行),但router.navigateByUrl(“)不起作用;