首页 > 解决方案 > 绑定 kendo.data.SchedulerDataSource 而不会出现找不到名称“kendo”错误

问题描述

我正在为 Angular 使用 C# Asp Net Core 3.1 和 Kendo UI(它已经由其他人为我设置好了)。我是 C# 和 Angular 的 Kendo UI(过去曾使用 JQuery 的 Kendo UI)和 Visual Studio 的新手。我需要将 Kendo UI 调度程序/日历小部件绑定到外部 RESTful Web 服务。

我有这些文件:

在 src/app/home/events-utc.ts 中有一个用硬编码的 json 对象定义的 const。将我的 src/assets/config/config.ts 静态 URL 更改为外部数据源后,我将 /src/app/home/events-utc.ts 中的硬编码 json 对象替换为以下内容:

import { Component } from \'@angular/core\';
import { SchedulerEvent } from \"@progress/kendo-angular-scheduler\";

const baseData = new kendo.data.SchedulerDataSource({
dataSource: {
    batch: true,
    transport: {
      read: {
        url: "api/Calendars/",
        dataType: "jsonp",
      },
    },
},
});

我得到一个

src/app/home/calendar/events-utc.ts:5:22 - error TS2304: Cannot find name 'kendo'.
error message

我查看了页面的源代码,没有看到 Kendo js 调用。但是我查看了我的 environment.ts 和 angular.ts 文件,我看到了这里提到的内容https://www.telerik.com/kendo-angular-ui/components/sampleapps/同样在 node-modules 目录中,我看到了 Telerik列出的模块。

那么剑道图书馆无法识别我做错了什么?

标签: asp.net-corec#-3.0kendo-ui-angular2

解决方案


推荐阅读