在混合(AngularJs+Angular)角度应用程序中,如果URL前缀以/测试开头,我想加载一个组件(比如ExampleComponent)。比方说,如果以下url中的任何一个被命中,我希望每次都加载ExampleComponent。
- /测试
- /测试/a/b?c=test
- /测试/a/b
- /测试/2222
- /测试/....
import { NgModule } from '@angular/core'; import { UIRouterUpgradeModule } from '@uirouter/angular-hybrid'; import { ExampleComponent } from './example.component'; @NgModule({ imports: [ UIRouterUpgradeModule.forChild( { states: [ { parent: 'Home', name: "test", url: "/test", component: ExampleComponent, permissions: [] } ] } ), ], declarations: [ExampleComponent], }) export class ExampleModule {}
我对此进行了一些研究(https://github.com/ui-router/angular-hybrid)但不幸的是,没有找到任何可行的解决方案。有人能告诉我混合路由器是否可行吗?TIA公司