简体   繁体   English

如何将引导样式应用于角度ui日期选择器

[英]How to apply bootstrap styles to angular ui datepicker

I'm using datepicker from angular.ui, and it styled with empty design which you can see in the site . 我使用的是来自angular.ui的datepicker,它的样式为空设计,您可以在网站上看到它。 Now I want to have bootstrap styled datepicker and timepicker without using extra libraries or plugins. 现在,我想使用引导程序样式的datepicker和timepicker,而无需使用额外的库或插件。 Is there a short way to apply bootstrap styles to calendar? 有没有一种简便的方法可以将引导样式应用于日历?

在此处输入图片说明

You have three options to modify the default angular-ui-bootstrap style: 您可以通过三个选项来修改默认的angular-ui-bootstrap样式:

  1. Edit the default templates and recompile angular-ui-bootstrap. 编辑默认模板,然后重新编译angular-ui-bootstrap。 All the templates are located in the template directory . 所有模板都位于template目录中 Eg datepicker templates are here . 例如datepicker模板在这里
  2. Override the default templates in you code. 覆盖代码中的默认模板。 By default if you use the -tpls- distribution version of angular-ui-bootstrap then all the templates are bundled inside $templateCache , see here . 默认情况下,如果您使用angular-ui-bootstrap的-tpls-发行版,则所有模板都捆绑在$templateCache ,请参见此处 So you could provide your own datepicker template overriding the default template eg $templateCache.put("template/datepicker/popup.html" 因此,您可以提供自己的日期选择器模板来覆盖默认模板,例如$templateCache.put("template/datepicker/popup.html"
  3. Or as per the docs: 或根据文档:

If, on the other hand default templates are not what you need you could take ui-bootstrap-[version].min.js and provide your own templates, taking the default ones ( https://github.com/angular-ui/bootstrap/tree/master/template ) as a starting point. 另一方面,如果您不需要默认模板,则可以使用ui-bootstrap- [version] .min.js并提供自己的模板,并使用默认模板( https://github.com/angular-ui/ bootstrap / tree / master / template )作为起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM