Angularjs jquery UI日期选择器缺少样式/css
我刚刚在谷歌上搜索了这个日期选择器,以便在angular中使用。问题是缺少样式/css:Angularjs jquery UI日期选择器缺少样式/css,angularjs,jquery-ui,angularjs-directive,Angularjs,Jquery Ui,Angularjs Directive,我刚刚在谷歌上搜索了这个日期选择器,以便在angular中使用。问题是缺少样式/css: myApp.directive('calendar', function () { return { require: 'ngModel', link: function (scope, el, attr, ngModel) { $(el).datepicker({
myApp.directive('calendar', function () {
return {
require: 'ngModel',
link: function (scope, el, attr, ngModel) {
$(el).datepicker({
dateFormat: 'yy-mm-dd',
onSelect: function (dateText) {
scope.$apply(function () {
ngModel.$setViewValue(dateText);
});
}
});
}
};
})
有人知道如何修改样式吗?看起来像jquery ui css还是什么?
jsfiddle:
在页面中添加对jquery-ui.css的引用检查此项 您只需要添加Ui.css 在jsFiddle的lef上的
external resources
选项卡中,您必须添加Ui的外部css
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
</body>
</html>
jQuery UI日期选择器-默认功能
$(函数(){
$(“#日期选择器”).datepicker();
});
日期:
JqueryUi需要一个Css。确保你已经添加了它。