javascript - AngularJS : date-time picker (vs) zoom in graph : one or the other not working

标签 javascript jquery angularjs twitter-bootstrap

在我的 AngularJS 应用程序中,我尝试根据用户选择的时间段(使用日期时间选择器)绘制图表。截图如下:

enter image description here

使用 1.7.1 时

正在使用bootstrap JS for date-time picker 。问题是,当我使用 JQuery 版本 1.7.1 时,图形缩放可以工作,但日期时间选择器不起作用。 这是浏览器控制台中的错误:

Error: Failed to execute 'appendChild' on 'Node': The new child element is null.
    at Error (native)
    at Function.f.extend.clean (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:4:4522)
    at Function.f.buildFragment (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:4:2303)
    at f.fn.extend.domManip (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:4:1672)
    at f.fn.extend.append (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:3:31818)
    at DateTimePicker.fillDate (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:9195)
    at DateTimePicker.update (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:6538)
    at DateTimePicker.init (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:2408)
    at new DateTimePicker (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:125)
    at HTMLDivElement.<anonymous> (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:23028) <div class="input-append ng-pristine ng-valid" startdatetime="" ng-model="var1" ng-style="{'display': 'inline-block'}"> angular1.2.1.js:84
Error: Failed to execute 'appendChild' on 'Node': The new child element is null.
    at Error (native)
    at Function.f.extend.clean (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:4:4522)
    at Function.f.buildFragment (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:4:2303)
    at f.fn.extend.domManip (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:4:1672)
    at f.fn.extend.append (https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js:3:31818)
    at DateTimePicker.fillDate (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:9195)
    at DateTimePicker.update (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:6538)
    at DateTimePicker.init (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:2408)
    at new DateTimePicker (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:125)
    at HTMLDivElement.<anonymous> (http://192.168.0.103:8080/restapi/date-picker/dateTimeBootstrap.js:26:23028) <div class="input-append ng-pristine ng-valid" enddatetime="" ng-model="var1" ng-style="{'display': 'inline-block'}">

使用 1.9.1 时

并且,使用 1.9.1 时,图形缩放不起作用,但日期时间选择器起作用。浏览器抛出此错误:

Uncaught TypeError: Cannot read property 'addClass' of undefined jquery-ui.min.js:380
    a.widget._mouseCapturejquery-ui.min.js:380
    a.widget._mouseDownjquery-ui.min.js:26
    (anonymous function)jquery-ui.min.js:25
    b.event.dispatchjquery.js:9593
    v.handle

PLUNKR代码

这是plunkr code 。 JQuery脚本版本代码指的是:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

最佳答案

将 AngularJS 与 jQuery 1.9.1 和 jQuery UI 1.8.15 或更低版本一起使用时存在不兼容问题。 只需升级到较新版本的 jQuery UI(在本例中为 1.9.2+)即可解决问题。

关于javascript - AngularJS : date-time picker (vs) zoom in graph : one or the other not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26625767/

相关文章:

javascript - 通过内容脚本设置的间隔被网页清除

javascript - cubic-bezier,如何为 y 获取 x?

javascript - 在 dijit.form.DateTextBox 中禁用手动输入

javascript - 使用 javascript 进行火复制

javascript - 如何使用 KnockoutJS 将客户端分页添加到表中?

javascript - 如何在 D3 JS 中制作色标以用于填充属性?

javascript - 使用ajax从另一个页面加载html时未定义函数

javascript - Google map - 如何确定点是否落在圆上并绘制 map

javascript - 键盘事件在 Chrome 53 中不起作用

javascript - 如果 Iframe 无法在 src 加载资源,如何显示替代图像?使用 AngularJs?