gha*_*sen 6 api angular angular-resolver
我使用 AngularResolver在显示路线之前从服务器预取数据,因此页面不会加载为空,我们对此原则表示同意。
我现在的问题是如何使用相同的方法Resolver在没有路由的情况下从服务器预取数据?为了更多地解释我的问题,这里是我的屏幕草图:
在我的应用程序的 HeadreComponent 上,我需要进行一些 api 调用来获取,person.firstName但person.lastName标头没有定义的路由,因为它应该显示在第一页上 (http:localhost:4200\home)。所以我无法在路由配置中使用常规语法来调用解析器,如下所示:
{path: 'home', component: HomeComponent, resolve: {personInfos: PersonInfoResolver}}
Run Code Online (Sandbox Code Playgroud)
我可能会错过一些我正在开始 Angular 开发的东西,所以请友善:D
| 归档时间: |
|
| 查看次数: |
4916 次 |
| 最近记录: |