草庐IT

getting-authentication-is-require

全部标签

javascript - 错误 TS2539 : Cannot assign to 'c' because it is not a variable

我有2个.ts文件,C.ts:exportletc:any=10;A.ts:import{c}from"./C";c=100;编译A.ts时报错:errorTS2539:Cannotassignto'c'becauseitisnotavariable.我该如何解决? 最佳答案 将它放在一个类中,并使其成为静态的exportclassGlobalVars{publicstaticc:any=10;}从任何其他文件导入之后GlobalVars.c=100; 关于javascript-错误TS

javascript - "Class extends value #<Object> is not a constructor or null"

感谢阅读我的文章我的代码出现此错误:“Classextendsvalue#isnotaconstructorornull”这是我的代码,我正在尝试导出/导入类。怪物.js:constminiMonster=require("./minimonster.js");classmonster{constructor(options={name},health){this.options=options;this.health=100;this.heal=()=>{return(this.health+=10);};}}letbigMonster=newmonster("Godzilla");

javascript - 在 TypeScript 中使用 import/require 获取接口(interface)声明

如果我使用///引用TypeScript声明文件(例如jquery.d.ts)语法,由我来确保通过其他方式加载相应的库,即仅引用.d.ts文件不会加载库。有没有办法让TypeScript生成require()在我使用它时调用图书馆?如果我不使用AMD/requirejs,我可以调用require手动,但我想让它与AMD一起工作。这样做的好处是我的依赖项不会在两个地方定义。从.ts文件引用库就足以确保它加载,而不必在我的HTML中手动维护依赖项列表。更新:我打开了一个newquestion这澄清了我的确切情况。由于我没有提供所有必要的详细信息,因此我想对我最初的问题的答案表示赞赏。

javascript - 安装 visual Studio 2015 社区版后,Crystal Reports 13 bobj is undefined JavaScript 错误

在带有CrystalReport13的VisualStudio2010中,我的项目运行良好。在我安装Visualstudio2015社区版之后供我个人使用。当我打开我的项目并在VisualStudio2010中运行时,它抛出“JavaScript运行时错误:‘bobj’未定义”。我浏览了一些网站http://www.mahadera.com/error-0x800a1391-javascript-runtime-error-bobj-is-undefined/http://www.aspsnippets.com/Articles/Crystal-Reports-13-Visual-St

javascript - Uncaught ReferenceError : Worker is not defined while trying to create a Worker within another Worker in Chrome

这link说:Workersmayspawnmoreworkersiftheywish.So-calledsub-workersmustbehostedwithinthesameoriginastheparentpage.Also,theURIsforsubworkersareresolvedrelativetotheparentworker'slocationratherthanthatoftheowningpage.Thismakesiteasierforworkerstokeeptrackofwheretheirdependenciesare.但是当我尝试在另一个Worker中创

javascript - 插入符范围和 package-lock.json : how to get latest non-breaking versions with them?

我知道package-lock.json代表什么,但我不明白添加此文件后插入符范围是如何工作的?假设我有一个包(my-module),我想拥有所有新的非破坏性版本,而无需手动指定新版本。我安装了最新版本,这是package.json文件中的结果:“我的模块”:“^4.1.1”但是package-lock.json也得到了更新,将my-module的版本修复为4.1.1。下次my-module会出现一个新版本:4.1.2。运行npmi不会安装它,因为package-lock.json中的版本固定为旧版本。问题我如何实现npmi将下载最新的非破坏性版本的my-module而无需创建新的pa

javascript - 请求动画帧 : what exactly is the timestamp?

我一直认为requestAnimationFrame使用的时间戳和JavaScript中常用的时间戳是一样的,就是从1970年1月1日开始的毫秒数,今天抓取时间戳验证了一下,发现RAF时间戳大概是从1970年1月1日开始算起的页面加载的开始。时间戳的精确测量依据是什么?测试代码:vari=0;varstart=null;vartimes=[];vardur=5000;functionstep(timestamp){if(start===null)start=timestamp;times[i++]=timestamp;if(timestamp-start');}}requestAnim

javascript - Leaflet.Geosearch : get lon/lat from address

在不懂JS的情况下,我被迫在网页上实现了一张map(OSM通过Leaflet)。在这张map上,应该有一个人的实际地址的标记。地址在数据库中保存为字符串。我可以看到一张map,可以给它添加标记,但在那之后,我就迷路了。我已经测试了一些Leaflet-geocoding-plugins,但我必须承认,对于我的实际编程体验而言,它们不够简单。另一个question是关于同样的问题,但我不明白,如何从L.Geosearch的地址获取经/纬度-Leaflet的插件。谁能给我提供一个查找地址的示例(通过OSMN或其他方式,而不是google/bing或其他需要api-key的提供商),将其转换为

javascript - webpack require.ensure 第一个参数使用

webpackrequire.ensure第一个参数第一个参数有什么用?https://webpack.github.io/docs/code-splitting.htmlrequire.ensure(dependencies,callback)我试过让第一个参数填充或为空,如:require.ensure(['./module'],function(){//filledfirstparamrequire.ensure([],function(){//emptyfirstparamletmodule=require('./module');$ocLazyLoad.load([{name

javascript - 未捕获的类型错误 : lang is not a function

这个问题在这里已经有了答案:JSfunctionnamed`animate`doesn'tworkinChrome,butworksinIE(3个答案)关闭6年前。在我的HTML中,我在script标签中定义了lang函数并添加了“TestFire!”单击时必须调用lang的按钮:TestingFunctionsfunctionlang(){alert("Hello,World!It'sJavaScriptthistime");}但是,如果我点击按钮,我会得到这个错误:UncaughtTypeError:langisnotafunction但是,如果我将函数名称从lang更改为任何其他