【问题标题】:Why isn't my code creating a Kendo widget?为什么我的代码没有创建 Kendo 小部件?
【发布时间】:2013-06-12 13:27:54
【问题描述】:

我只是在复制 kendo 网站上提供的演示代码,但它仍然没有在输出中提供任何小部件,并且它给出了以下错误 -

Angular JS 中的“TypeError: undefined is not a function”。

我还为它创建了一个新的 jsfiddle,这是链接- http://jsfiddle.net/akki166786/MYe2T/

有人知道这里有什么问题吗? 这是我的代码

<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>

该错误与“ng-transclude”有关,因为如果我删除下拉列表部分,则我没有收到任何错误,但仍然没有得到日历控件。

【问题讨论】:

    标签: angularjs kendo-asp.net-mvc


    【解决方案1】:

    我也有同样的问题。

    您的代码似乎基于以下页面: http://kendo-labs.github.io/angular-kendo/

    该库有不同版本(“angular-kendo.js”文件):

    1. 示例中的一个(看起来是旧版本)
    2. 另一个来自 github 根文件夹https://github.com/kendo-labs/angular-kendo
    3. 并且来自 github js 文件夹

    某些功能在指向不同/旧版本时有效。

    编辑: 解决方案是从浏览器源中获取 html 示例。因此,只需查看页面的源代码并使用该示例即可。这个对我有用。页面上的示例很旧。

    【讨论】:

    • 感谢您的回答。但是我怎样才能获得它的旧版本,或者是否有任何更新的链接可以与更新的库一起使用?
    猜你喜欢
    • 1970-01-01
    • 2020-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多