如何更改UI的视图模板编程网址视图、如何更改、模板、网址

2023-09-13 03:15:25 作者:呆滞与梦

我想改变用户界面视图 templateUrl 编程从控制器里面,因为 templateUrl 选项不支持服务的注入,我需要一个服务,以确定该模板URL。

I want to change the ui-view templateUrl programatically from inside a controller because the templateUrl option does not support injection of services and I need a service to determine the template URL.

感谢您。

推荐答案

请参阅 templateProvider 的文档在这里:https://github.com/angular-ui/ui-router/wiki/Quick-Reference#template-templateurl-templateprovider