草庐IT

a_function_should_be_runned

全部标签

javascript - 编译转换 : The type or namespace name could not be found when running TypeLite. tt

免责声明:我对这里使用的几乎每一项技术都是新手,所以如果我遗漏了明显的内容,请原谅我......我开始将MVC4与EntityFramework5和WebAPI混为一谈,我想使用TypeScript和Knockout来做一些UI的事情。我找到了TypeLite项目,它将采用我的EF模型并为我生成TypeScript接口(interface),以便所有内容都是“强”类型的。我的解决方案包含3个项目:MyApp.dll=包含所有MVC工作MyApp.Domain.dll=包含EF域模型MyApp.WebAPI.dll=包含WebAPI工作我将TypeLite引用添加到MyApp项目(通过N

javascript - (function() {})() 声明/初始化 javascript 函数

这个问题已经存在:关闭12年前。PossibleDuplicate:JavaScript:Whytheanonymousfunctionwrapper?想请教一下,为什么要把所有东西都包裹起来(function(){document.write("HelloWorld!");})();功能?

javascript - Handlebars : What is the best way to pass multiple parameters to a registerHelper function?

我正在使用Handlebars在表格中呈现数据。其中一个数据项需要处理,它会考虑一些参数以提供结果。模板化文本示例:{{getOutputByParametersparam1=DataFieldName1param2=DataFieldName2}}相应的registerHelper会写成:var__this=this;Handlebars.registerHelper('getOutputByParameters',function(params){__this.getOutputByParameters(params.hash.param1,params.hash.param2)}

javascript - AngularJS 在 app.run() 中的 promise

这个问题在这里已经有了答案:AngularJS:Initializeservicewithasynchronousdata(10个答案)关闭5年前。我正在研究angularJs和typescript项目。在启动客户端应用程序和加载UI之前,我必须进行同步http调用并从服务器获取一些数据。我在互联网上搜索,看到每个人都在谈论promise,嗯,好吧,为什么不呢。所以我在我的app.run()中使用了promise(进行$http调用并使用$q返回promise)。也许我什么也没遗漏,因为这根本不起作用。Angular启动app.config(),然后app.run(),...但是Ang

javascript - ngx-datatables 在排序时给出 "rxjs_1.fromEvent is not a function"错误

我只是按照演示来展示一个简单的数据表。这是我的代码:columns=[{name:'ID',prop:'id'},{name:'StreetAddress',prop:'address.street'},{name:'Suburb',prop:'address.suburb'},{name:'State',prop:'address.state'},{name:'ManagerName',prop:'manager.name'},{name:'ManagerCompany',prop:'manager.company'},];排序确实有效,但是,当我单击列对记录进行排序时,我也会收到此

javascript - $ 与 jQuery : Which should I use?

它们有什么区别?哪个更好? 最佳答案 $isanaliasforjQuery,也不是真的“更好”,提供jQuery以防某些else使用$,例如Prototype(或jQuery.noConflict()被调用另一个原因...)。为了简洁,我更喜欢$因为我知道它指的是jQuery,如果您不确定(比如在编写插件时),请使用jQuery作为您的主要引用,例如:(function($){//insidehere$meansjQuery})(jQuery); 关于javascript-$与jQue

javascript - 继承和 TypeScript 错误 : X is not a constructor function type

我有一个父类(superclass),我希望从中继承其他两个类。下面列出了这些类(class)。当我编译时,试图继承的两个类提示父类(superclass)(给出相同的错误):“[类文件路径(在本例中为A)]不是构造函数类型”A.tsexportclassA{//privatefields...constructor(username:string,password:string,firstName:string,lastName:string,accountType:string){//initialisation}}B.tsimportA=require('./A);exportc

javascript - "Self Invoking Anonymous Functions"的用途

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Whatisthepurposeofaselfexecutingfunctioninjavascript?希望是一个非常直截了当的问题:使用自调用匿名函数的目的是什么?仅仅是为了防止变量等“污染”全局范围吗?或者使用它们还有其他优势吗?

javascript - (typeof variable === "function") 和 jQuery.isFunction() 有什么区别?

我一直使用(typeofvariable==="function")并且偶然发现了jQuery.isFunction()我想知道:typeof方法和jQuery的方法有什么区别?不仅有什么区别,而且什么时候用typeof方法合适,什么时候用jQuery的方法合适? 最佳答案 除了使用jQuery稍慢之外,几乎没有区别。查看源代码:isFunction:function(obj){returnjQuery.type(obj)==="function";},它调用一个函数,该函数调用另一个函数来确定与您显示的完全相同的东西:P在这种情况

javascript - 无法在 'requestAnimationFrame' : The callback provided as parameter 1 is not a function. 上执行 'Window'

不确定我在这里做错了什么......window.requestAnimFrame=function(){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(/*function*/callback){window.setTimeout(callback,1000/60);});}();