我刚刚下载了TypeScript文档.我有一些JavaScript类,我想在TypeScript测试应用程序中创建和使用这些类
如何从TypeScript调用包含的JavaScript的JavaScript函数.我不想创建"d.ts"文件.只是为了创建我的类,调用它的方法,访问它的属性.
我怎么做?
我正在尝试将kendoUI与TypeScript一起使用.
例如,要显示我必须要做的窗口:
logonDlg.show();
例
var logonDlg = $("logonDialog");
if (!logonDlg.data("kendoWindow")) {
logonDlg.kendoWindow(logOnParams);
logonDlg.show();
}
Run Code Online (Sandbox Code Playgroud)
它工作正常.JS是按照我的意愿生成的,但是我收到一个错误,因为属性'kendoWindow'在'JQuery'类型的值上不存在.
如何禁用此类错误.我不能说,瑞安说,工作.
我试图将Simpl5 javascript库添加 到我的网关失败.我把SIPml-api.js和SIPml.js放在webapp/content/scripts文件夹中.
在.angular-cli.json我更新了脚本数组,如下所示:
"scripts": [
"content/scripts/SIPml-api.js",
"content/scripts/SIPml.js"
]
Run Code Online (Sandbox Code Playgroud)
然后我尝试在组件中调用SIPml,如下所示:
import { Component, OnInit } from '@angular/core';
declare var SIPml: any;
Run Code Online (Sandbox Code Playgroud)
.
ngOnInit() {
SIPml.setDebugLevel((window.localStorage && window.localStorage.getItem('org.doubango.expert.disable_debug') === 'true') ? 'error' : 'info');
}
Run Code Online (Sandbox Code Playgroud)
我收到ERROR ReferenceError:控制台中未定义SIPml.
有人可以帮忙吗?