更改 Angular ui-bootstrap 模板的文件夹位置 [英] Change the folder location for Angular ui-bootstrap templates
问题描述
我正在尝试将 ui-bootstrap.min.js 与外部模板一起使用.
I am trying to use ui-bootstrap.min.js with the external templates.
我得到的错误是:
http://localhost:13132/Place/template/timepicker/timepicker.html 404 (Not Found)
我希望为每个页面,每个模板,在以下位置查找我的模板:
I would like for every page, for every template, it to look for my templates under:
http://localhost:13132/js/app/template/...
但我似乎找不到可以更改 this 指向的位置的位置.
but I cannot seem to find where I could change the location where this is pointing to.
有人知道如何进行此更改吗?
Anyone know how to make this change?
推荐答案
Per 这个问题 在 github 上,templateUrl 不可配置.您可以更改每个指令定义中的 templateUrl 属性
Per this issue on github, the templateUrl is not configurable. You could change the templateUrl property in each directive definition
.directive('accordion', function () {
return {
restrict:'EA',
controller:'AccordionController',
transclude: true,
replace: false,
templateUrl: 'template/accordion/accordion.html'
};
但这会很脆弱且难以维护.不幸的是,看起来他们不会让这个可配置 - 但该线程是一个有趣的阅读.
but that would be brittle and hard to maintain. Unfortunately, it doesn't look like they're going to make this configurable - but the thread is an interesting read.
这篇关于更改 Angular ui-bootstrap 模板的文件夹位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!