ui-bootstrap-tpls.min.js 和 ui-bootstrap.min.js 有什么区别? [英] What is the difference between ui-bootstrap-tpls.min.js and ui-bootstrap.min.js?

查看:22
本文介绍了ui-bootstrap-tpls.min.js 和 ui-bootstrap.min.js 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 cdnjs 上的 Angular-UI-Bootstrap 页面上,说:

At the Angular-UI-Bootstrap page on cdnjs, is says:

用于 Twitter 引导程序的原生 AngularJS (Angular) 指令.占用空间小(gzipped 5 kB!),不需要第三方 JavaScript 依赖项(jQuery、Bootstrap JavaScript)!

Native AngularJS (Angular) directives for Twitter's Bootstrap. Small footprint (5 kB gzipped!), no third-party JavaScript dependencies (jQuery, Bootstrap JavaScript) required!

... 并且有选项

//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 these shows a subtle difference, and I can't seem to find any documentation on it...

长话短说,除非您要创建自定义,否则请使用 tpls模板.

Long story short, use tpls unless you are going to create customized templates.

这里有记录:github.com/angular-ui/bootstrap/tree/gh-pages#build-files(链接自主页也是如此).简而言之 -tpls 版本具有默认引导程序模板捆绑.在任何情况下,您都应该只包含其中之一列出的文件.- 感谢 pkozlowski.opensource

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 Bootstrap templates bundled. In any case you should only include one of the listed files. - Thanks pkozlowski.opensource

推荐答案

所以,ui-bootstrap-tpls.min.js == (ui-bootstrap.min.js + HTML 模板) 需要通过 JavaScript 代码.如果您只包含 ui-bootstrap.min.js,您还需要提供自己的 HTML 模板.

So, ui-bootstrap-tpls.min.js == (ui-bootstrap.min.js + HTML templates) required by the JavaScript code. If you only included ui-bootstrap.min.js, you will also need to provide your own HTML templates.

否则你会看到类似:

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-bootstrap-tpls.min.js 和 ui-bootstrap.min.js 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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