Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs jquery UI日期选择器缺少样式/css_Angularjs_Jquery Ui_Angularjs Directive - Fatal编程技术网

Angularjs jquery UI日期选择器缺少样式/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({

我刚刚在谷歌上搜索了这个日期选择器,以便在angular中使用。问题是缺少样式/css:

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。确保你已经添加了它。