人们已经回答了这个问题,但我想指出,从版本0.13.4开始,我们已经添加了根据具体情况提供自己的模板的能力(即,每个指令使用,而不是应用程序范围)但是,后者并不难做到)。
该 tpls tag表示该文件还包含模板。
tpls
这是一个例子:
angular.module("ui.bootstrap" ["ui.bootstrap.transition" "ui.bootstrap.collapse" "ui.bootstrap.accordion" "ui.bootstrap.alert" "ui.bootstrap.bindHtml" "ui.bootstrap.buttons" "ui.bootstrap.carousel" "ui.bootstrap.position" "ui.bootstrap.datepicker" "ui.bootstrap.dropdownToggle" "ui.bootstrap.modal" "ui.bootstrap.pagination" "ui.bootstrap.tooltip" "ui.bootstrap.popover" "ui.bootstrap.progressbar" "ui.bootstrap.rating" "ui.bootstrap.tabs" "ui.bootstrap.timepicker" "ui.bootstrap.typeahead"]); angular.module('ui.bootstrap.transition' [])
angular.module("ui.bootstrap" ["ui.bootstrap.tpls" "ui.bootstrap.transition" "ui.bootstrap.collapse" "ui.bootstrap.accordion" "ui.bootstrap.alert" "ui.bootstrap.bindHtml" "ui.bootstrap.buttons" "ui.bootstrap.carousel" "ui.bootstrap.position" "ui.bootstrap.datepicker" "ui.bootstrap.dropdownToggle" "ui.bootstrap.modal" "ui.bootstrap.pagination" "ui.bootstrap.tooltip" "ui.bootstrap.popover" "ui.bootstrap.progressbar" "ui.bootstrap.rating" "ui.bootstrap.tabs" "ui.bootstrap.timepicker" "ui.bootstrap.typeahead"]); angular.module("ui.bootstrap.tpls" ["template/accordion/accordion-group.html" "template/accordion/accordion.html" "template/alert/alert.html" "template/carousel/carousel.html" "template/carousel/slide.html" "template/datepicker/datepicker.html" "template/datepicker/popup.html" "template/modal/backdrop.html" "template/modal/window.html" "template/pagination/pager.html" "template/pagination/pagination.html" "template/tooltip/tooltip-html-unsafe-popup.html" "template/tooltip/tooltip-popup.html" "template/popover/popover.html" "template/progressbar/bar.html" "template/progressbar/progress.html" "template/rating/rating.html" "template/tabs/tab.html" "template/tabs/tabset-titles.html" "template/tabs/tabset.html" "template/timepicker/timepicker.html" "template/typeahead/typeahead-match.html" "template/typeahead/typeahead-popup.html"]); angular.module('ui.bootstrap.transition' [])
例如: 的 模板/警报/ alert.html 强>
angular.module("template/alert/alert.html", []).run(["$templateCache", function($templateCache) { $templateCache.put("template/alert/alert.html", "<div class='alert' ng-class='type && \"alert-\" + type'>\n" + " <button ng-show='closeable' type='button' class='close' ng-click='close()'>×</button>\n" + " <div ng-transclude></div>\n" + "</div>\n" + ""); }]);