如何以编程方式更改 ui-view 模板 URL [英] How to change ui-view template URL programatically

查看:22
本文介绍了如何以编程方式更改 ui-view 模板 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从控制器内部以编程方式更改 ui-view 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 的文档:
"快速参考 - 模板、templateUrl、templateProvider", Github - angular-ui/ui-router

See the docs for templateProvider here:
"Quick Reference - template, templateUrl, templateProvider", Github - angular-ui/ui-router

这篇关于如何以编程方式更改 ui-view 模板 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆