![](/img/trans.png)
[英]AngularJS 1.4 error - Uncaught TypeError: Cannot read property 'apply' of undefined
[英]Why does this simple Angularjs using syncfusion throws me the error Uncaught TypeError: Cannot read property 'widget' of undefined
我對 Angularjs 比較陌生,我正在嘗試使用Syncfusion
來實現一些圖表,所以我從一個簡單的代碼開始,使用他們網站上提供的angularjs CDN
。 但這給我帶來了錯誤。 我不確定我做錯了什么。 我在 SO 或 Syncfusion 論壇中找不到任何與類似事物相關的帖子。 誰能幫幫我嗎? 如果這是重復的,我真的很抱歉
這是他們網站上的幫助文檔: Help DOC Syncfusion AngularjS
這是 CDN 鏈接頁面: https://help.syncfusion.com/js/cdn#gsc.tab=0
以下是代碼:
<!DOCTYPE html>
<html ng-app="DateCtrl">
<head>
<title>Testing EJAngular</title>
<!--jQuery Starts-->
<script src="http://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js"></script>
<!--jQuery Ends-->
<!-- Angularjs CDN Starts -->
<script src="http://cdn.syncfusion.com/js/assets/external/angular.min.js"></script>
<!-- Angularjs CDN Ends -->
<!--EJ Angular Starts-->
<script src="http://cdn.syncfusion.com/18.2.0.44/js/common/ej.widget.angular.min.js"></script>
<!--EJ Angular ENDS -->
</script>
</head>
<body ng-controller="DatePickerCtrl">
<!--Container for ejDatePicker widget-->
<input id="datepick" ej-datepicker e-value="dateValue" e-enableStrictMode="true" />
<script type="text/javascript">
var DateCtrl = angular.module('DateCtrl', ['ejangular'])
DateCtrl.controller('DatePickerCtrl', function ($scope) {
$scope.dateValue = "2/3/2013";
});
</script>
</body>
</html>
發布此答案,因為它可能對將來的某人有用。 需要添加更多的 CDN。 這是所有CDN:
<link href="http://cdn.syncfusion.com/18.2.0.44/js/web/flat-azure/ej.web.all.min.css" rel="stylesheet" />
<script src="http://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js"></script>
<script src="http://cdn.syncfusion.com/js/assets/external/jquery.easing.1.3.min.js"></script>
<script src="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></script>
<script src="http://cdn.syncfusion.com/18.2.0.44/js/web/ej.web.all.min.js"></script>
<!-- Angularjs CDN Starts -->
<script src="http://cdn.syncfusion.com/js/assets/external/angular.min.js"></script>
<!-- Angularjs CDN Ends -->
<!--EJ Angular Starts-->
<script src="http://cdn.syncfusion.com/18.2.0.44/js/common/ej.widget.angular.min.js"></script>
<!--EJ Angular ENDS -->
當我們沒有引用所需的 Syncfusion 腳本文件時,通常會出現此問題。 查看以下鏈接中的 AngularJS 文檔。
https://help.syncfusion.com/angularjs/overview
檢查以下鏈接以獲取 DatePicker 演示。
http://jsplayground.syncfusion.com/a1zdhiii
檢查以下鏈接以了解有關 Syncfusion AngularJS DatePicker 的更多信息。
行為: https://help.syncfusion.com/angularjs/datepicker/behavior-settings
值綁定: https://help.syncfusion.com/angularjs/datepicker/data-and-event-binding
API 參考: https://help.syncfusion.com/api/js/ejdatepicker
我們也可以在 Syncfusion 論壇中提出疑問。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.