Why isn't my code creating a Kendo widget?

你。 提交于 2019-12-07 16:16:46

问题


i am just copying the demo code which is available on kendo's site but still it is not giving any widget in output, and it is giving the following error -

"TypeError: undefined is not a function" in angular JS.

i have also created a new jsfiddle for it here is the link- http://jsfiddle.net/akki166786/MYe2T/

Do anybody has any idea what is wrong in here? here is my code

<script src="~/Scripts/jquery-1.7.1.min.js"></script>
<script src="~/Scripts/angular/angularjs.js"></script>
<script src="~/Scripts/angular/underscore.js"></script>
<script src="~/Scripts/Kendo/kendo.all.min.js"></script>
<script src="~/Scripts/angular/angular-kendo.js"></script>

<script>
    var myModule = angular.module('myApp', ["kendo.directives"]);
</script>

<div ng-app="myApp">
    <div data-kendo data-role="calendar"></div>
    <ul data-kendo data-role="dropdownlist" ng-transclude>
        <li>element 1</li>
        <li>element 2</li>
    </ul>

</div>

The error is some thing related to "ng-transclude" because if i remove the dropdownlist portion then i didnt get any error, but still dont get the caledar control also.


回答1:


I am having the same problem.

It looks like you have based your code on the following page: http://kendo-labs.github.io/angular-kendo/

There are different versions of that library ("angular-kendo.js" file):

  1. One from example (it looks like it is an older version)
  2. Another from the github root folder https://github.com/kendo-labs/angular-kendo
  3. And from the github js folder

Some of the functionality works when pointing to the different/older version.

Edit: Solution is to get html example from the browser source. So just view the source of the page and use that example. It works for me. Examples on the page are old.



来源:https://stackoverflow.com/questions/17066799/why-isnt-my-code-creating-a-kendo-widget

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!