angular 2默认路由未按预期工作

时间:2018-01-19 19:28:04

标签: angular angular-routing

我在routing.module.ts中的代码:

const routes: Routes = [
    { path: '', redirectTo: 'Home', pathMatch: 'full' },
    { path: 'Home', component: HomeComponent },
    { path: 'Dashboard', component: DashboardComponent }    
];

我的angular2应用程序可以从其他Web应用程序访问。以下是该Web应用程序的URL:

http://myserver/virtualDir/

点击此网址后,我的angular2应用程序正在加载,但它没有重定向到主页。相反,我只看到标题。当我按Ctrl + F5主页加载时,网址也在变化。

在其他Web应用程序上如果我在末尾提供没有斜杠“/”的URL,则单击链接应用程序将转到主页。我无法弄清楚这里有什么问题。

1 个答案:

答案 0 :(得分:0)

尝试在index.html文件中设置base-href

select t1.* from table1 t1 inner join 
(select code,max(date) maxDate from table1 group by code) t2
ON t1.code = t2.code and t1.date = t2.maxDate