asp.net-core - 绑定 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/calendar/calendar.component.css
- src/app/home/日历/component.html
- src/app/home/日历/component.spect.ts
- src/app/home/component.ts
- src/app/home/events-utc.ts
在 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列出的模块。
那么剑道图书馆无法识别我做错了什么?
解决方案
推荐阅读
- jquery - 如何在 AJAX 中使用最接近的 Jquery?
- sorting - Slickgrid 对层次结构进行排序
- javascript - 如何在 MarkLogic REST 函数中设置自定义 HTTP 代码
- google-chrome - Selenium Webdriver Headless Mode 显示空白页
- javascript - 同步(非被动)滚动事件
- c# - 在 DBF 文件的 OleDB 连接字符串中设置字符集 1251
- java - Gradle 附加 zip 存档
- python - 如何在“Array”类型的 python pandas 数据框列中检查 AND 和 OR 条件?
- reactjs - 如何从外部网络访问 React 应用程序?
- angular - Angular - 在另一个组件中使用 observable(在异步数据调用中获取值)