小编mcf*_*esh的帖子

如何使用Angular 2访问API?

我希望能够在我的Angular 2应用程序之外导航到mywebsite.com/api.这应该带我到同一服务器托管的API应用程序.

这是我目前的路线设置.

export const routes: Routes = [
  {path: '', redirectTo: '/home', pathMatch: 'full'},
  {path: 'home', component: HomeComponent},
  {path: 'registration', component: RegistrationComponent},
  {path: '**', redirectTo: '/home', pathMatch: 'full'}
];
Run Code Online (Sandbox Code Playgroud)

如何排除路径,因为我不需要组件或模板?

angular2-routing angular2-services angular

5
推荐指数
1
解决办法
1912
查看次数