[英]unable to call jquery datetimepicker function in custom directive
I have made a custom directive in angularJs which is used to show datetimepicker. 我在angularJs中做了一个自定义指令,用于显示datetimepicker。
app.directive("timePicker", function() {
return {
restrict: "A",
link: function(scope, elem, attrs) {
//On click
$(elem).click(function() {
$(this).datetimepicker();
});
}
};
});
used it like this in html 在html中像这样使用它
<div>
<input type="text" name="basic_example_1" id="basic_example_1" value="" class="hasDatepicker"
time-picker>
</div>
I am using following js files. 我正在使用以下js文件。
<script src='appResources/js/jquery-ui-sliderAccess.js'></script>
<script src='appResources/js/jquery-ui-timepicker-addon.js'></script>
<script src='appResources/js/jquery-ui-timepicker-addon-i18n.min.js'></script>
<link href="appResources/css/jquery-ui-timepicker-addon.css" rel="stylesheet" />
I am referring from this site to get datetimepicker here 我从这个网站指获得的DateTimePicker 这里
try to use only: 尝试仅使用:
jquery-ui-timepicker-addon.js
and check console log, maybe there are errors 并检查控制台日志,也许有错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.