加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – PrimeNG日历错误 – 未定义JQuery

发布时间:2020-12-17 08:53:58 所属栏目:安全 来源:网络整理
导读:我想在我的应用程序中使用 PrimeNG calendar.当我运行代码时,我收到错误: ReferenceError: jQuery is not defined. 其他PrimeNG指令工作正常.如果我删除 p-calendar错误消失了. 我在我的应用中导入并包含了日历. 顺便说一下,我正在使用最新版本的角度,路由
我想在我的应用程序中使用 PrimeNG calendar.当我运行代码时,我收到错误:

ReferenceError: jQuery is not defined.

其他PrimeNG指令工作正常.如果我删除< p-calendar>错误消失了.

我在我的应用中导入并包含了日历.
顺便说一下,我正在使用最新版本的角度,路由器和表格.在此之前我有这个issue并通过更新表单提供程序修复它.

<p-calendar [(ngModel)]="date"></p-calendar>

Stacktrace摘录:

ReferenceError: jQuery is not defined
at Calendar.ngAfterViewInit (eval at (07002),:44:90)
at DebugAppView._View_AddShipmentComponent0.detectChangesInternal (AddShipmentComponent.template.js:930:59)
at DebugAppView.AppView.detectChanges (eval at (07003),:243:14)
at DebugAppView.detectChanges (eval at (07003),:348:44)

您需要添加依赖项:
<!-- Datetimepicker,Slider,Schedule -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.6.1/jquery-ui-timepicker-addon.min.js"></script>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读