什么是UI的引导,tpls.min.js和UI-bootstrap.min.js之间的区别 [英] What is the difference between ui-bootstrap-tpls.min.js and ui-bootstrap.min.js
问题描述
在角-UI-引导上cdnjs页面,是说:
本机AngularJS(角)指令对Twitter的引导。占地面积小(5kB的gzip压缩!),没有第三方JS依赖(jQuery的,JS引导)需要!
......并有选项
// cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.6.0/ui-bootstrap-tpls.min.js
和
// cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.6.0/ui-bootstrap.min.js
Diff'ing这些节目一个微妙的差异,而我似乎无法找到它的任何文件...
修改
长话短说使用第三方物流企业,除非你要创建自定义
模板。
块引用>修改
这是记录在这里:
github.com/angular-ui/bootstrap/tree/gh-pages#build-files(来自链接
主页以及)。总之-tpls版本的默认BS
模板捆绑在一起。在任何情况下,你应该只包括一
列出的文件。 - 谢谢pkozlowski.opensource
块引用>解决方案因此, UI的引导-tpls.min.js ==(UI-bootstrap.min.js + HTML模板)要求由JS。如果你只包括UI的bootstrap.min.js,您还需要提供自己的HTML模板。
否则,你将看到类似这样的:
GET HTTP://本地主机:8989 /你好世界/模板/提示/提示-popup.html 404(未找到)angular.js:7073
错误:[$编译:tpload] http://errors.angularjs.org/undefined/$compile/tpload?p0=template%2Ftooltip%2Ftooltip-popup.html
在错误(小于匿名>)
在http://本地主机:8989 /你好世界/ JS /供应商/角-1.2.0-rc.3 / angular.min.js:6:453
在http://本地主机:8989 /你好世界/ JS /供应商/角-1.2.0-rc.3 / angular.min.js:54:14
在http://本地主机:8989 /你好世界/ JS /供应商/角-1.2.0-rc.3 / angular.min.js:64:438
在A(HTTP://本地主机:8989 /你好世界/ JS /供应商/角-1.2.0-rc.3 / angular.min.js:89:258)
在A(HTTP://本地主机:8989 /你好世界/ JS /供应商/角-1.2.0-rc.3 / angular.min.js:89:258)
在http://本地主机:8989 /你好世界/ JS /供应商/角-1.2.0-rc.3 / angular.min.js:90:465
。在G $的eval(HTTP://本地主机:8989 /你好世界/ JS /供应商/角-1.2.0-rc.3 / angular.min.js:98:272)
在G $摘要。(HTTP://本地主机:8989 /你好世界/ JS /供应商/角-1.2.0-rc.3 / angular.min.js:96:142)
在G $适用。(HTTP://本地主机:8989 /你好世界/ JS /供应商/角-1.2.0-rc.3 / angular.min.js:99:100)At the Angular-UI-Bootstrap page on cdnjs, is says:
Native AngularJS (Angular) directives for Twitter's Bootstrap. Small footprint (5kB gzipped!), no 3rd party JS dependencies (jQuery, bootstrap JS) required!
... and has options for
//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.6.0/ui-bootstrap-tpls.min.js
and
//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.6.0/ui-bootstrap.min.js
Diff'ing these shows a subtle difference, and I can't seem to find any documentation on it...
Edit:
Long story short use tpls unless you are going to create customized templates.
Edit:
It is documented here: github.com/angular-ui/bootstrap/tree/gh-pages#build-files (linked from the home page as well). In short the -tpls version has default BS templates bundled. In any case you should only include one of the listed files. - Thanks pkozlowski.opensource
解决方案So, ui-bootstrap-tpls.min.js == (ui-bootstrap.min.js + html templates) required by the js. If you only included ui-bootstrap.min.js, you will also need to provide your own html templates.
Otherwise you will see something like:
GET http://localhost:8989/hello-world/template/tooltip/tooltip-popup.html 404 (Not Found) angular.js:7073 Error: [$compile:tpload] http://errors.angularjs.org/undefined/$compile/tpload?p0=template%2Ftooltip%2Ftooltip-popup.html at Error (<anonymous>) at http://localhost:8989/hello-world/js/vendor/angular-1.2.0-rc.3/angular.min.js:6:453 at http://localhost:8989/hello-world/js/vendor/angular-1.2.0-rc.3/angular.min.js:54:14 at http://localhost:8989/hello-world/js/vendor/angular-1.2.0-rc.3/angular.min.js:64:438 at A (http://localhost:8989/hello-world/js/vendor/angular-1.2.0-rc.3/angular.min.js:89:258) at A (http://localhost:8989/hello-world/js/vendor/angular-1.2.0-rc.3/angular.min.js:89:258) at http://localhost:8989/hello-world/js/vendor/angular-1.2.0-rc.3/angular.min.js:90:465 at g.$eval (http://localhost:8989/hello-world/js/vendor/angular-1.2.0-rc.3/angular.min.js:98:272) at g.$digest (http://localhost:8989/hello-world/js/vendor/angular-1.2.0-rc.3/angular.min.js:96:142) at g.$apply (http://localhost:8989/hello-world/js/vendor/angular-1.2.0-rc.3/angular.min.js:99:100)
这篇关于什么是UI的引导,tpls.min.js和UI-bootstrap.min.js之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!