使用angular2 开发pc端,路由是用懒加载方式
当我从home页面点击跳转到content页面之后,点击回退按钮就没办法回退了。
路由代码
const routes: Routes = [
{
path: '',
component: AppComponent,
children: [
{path: '', redirectTo: '/home', pathMatch: 'full'},
{path: 'home', loadChildren: 'app/modules/home/home.modules#HomeModule'},
{path: 'content', loadChildren: 'app/modules/content/content.modules#ContentModule'}
]
}
];
export const routing: ModuleWithProviders = RouterModule.forRoot(routes);
ps: home是一个module,content是另外一个module。
我自己在回退之前,除了一个bug,导致回退失败!事实上是可以回退的!