angularjs – ui-bootstrap-tpls.min.js和ui-bootstrap.min.js之间的区别是什么

前端之家收集整理的这篇文章主要介绍了angularjs – ui-bootstrap-tpls.min.js和ui-bootstrap.min.js之间的区别是什么前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在cdnjs的 Angular-UI-Bootstrap page,说:

本地AngularJS(Angular)指令为Twitter的Bootstrap。小脚本(5kB gzipped!),没有第三方JS依赖(jQuery,bootstrap 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

差异这些显示了一个微妙的差别,我似乎找不到任何文档…

编辑:

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

编辑:

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

所以,js需要的ui-bootstrap-tpls.min.js ==(ui-bootstrap.min.js html模板)。如果你只包括ui-bootstrap.min.js,你还需要提供你自己的html模板。

否则你会看到类似:

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)
原文链接:https://www.f2er.com/angularjs/147762.html

猜你在找的Angularjs相关文章