草庐IT

property_get

全部标签

javascript - Webpack:TypeError:无法读取未定义的属性 'properties'

这是有问题的分支和repo:https://github.com/Futuratum/moon.holdings/tree/dev/Users/leongaban/projects/Futuratum/moon.holdings/node_modules/webpack-cli/bin/config-yargs.js:89describe:optionsSchema.definitions.output.properties.path.description,不确定为什么会出现此错误,但我已从Webpack3升级到4。网页包/*eslint-disableno-console*/imp

javascript - require.js 未捕获类型错误 : cannot read property '__module_path__; of undefined

所以我刚刚开始尝试掌握require.js,但它似乎不起作用。当我使用标签将其包含在我的html中时:在chrome中加载页面时出现以下错误UncaughtTypeError:Cannotreadproperty'__MODULE_PATH__'ofundefined->require.js:538在firefox中我得到一个稍微不同的错误:TypeError:parentisundefined->require.js:538不知道我怎么会导致这个问题,因为它是require.js的全新安装,我的main.js中还没有代码。提前致谢 最佳答案

javascript - JavaScript : How to get resolve value for all promises? 中的 Promise.all

我编写了以下node.js文件:varcsv=require('csv-parser');varfs=require('fs')varPromise=require('bluebird');varfilename="devices.csv";vardevices;Promise.all(read_csv_file("devices.csv"),read_csv_file("bugs.csv")).then(function(result){console.log(result);});functionread_csv_file(filename){returnnewPromise(fu

javascript - Angular.js 从外部 Controller 调用 $http.get

我有一个HTTP资源,它返回数据库中排名前10的实体的JSON列表。我这样调用它:varfilter="john";varmyApp=angular.module('myApp',[]);myApp.controller('SearchController',['$scope','$http',function($scope,$http){$http.get('/api/Entity/Find/'+filter).//Getentitiesfilteredsuccess(function(data,status,headers,config){$scope.entities=data;

javascript - AngularJS Controller 错误 - : $http. get 不是 Controller 部分中的函数

varhsbc=angular.module('hsbc',['ngResource','ngRoute']);hsbc.config(['$routeProvider','$locationProvider',function($routeProvider,$locationProvider){//console.log('configpartworking');$routeProvider.when('/login',{controller:'hsbccontroller',templateUrl:'modules/authentication/views/login.html',

javascript - 错误 :Property 'select' does not exist on type HTMLElement

functioncopy(){varUrl=document.getElementById("Id");Url.select();//errordocument.execCommand("Copy");//browsercopy}如上。我正在尝试制作一个在浏览器中复制文本的功能。但是出现了标题错误在typescript中。我认为select()是有效的(link),因为我在演示中使用它时可以正确复制。我的ts版本是2.8.1 最佳答案 您需要添加一个typeassertion:varUrl=document.getElementBy

javascript - 未捕获的类型错误 : cannot read property 'innerHTML' of null

谁能解释一下这个错误是什么?UncaughtTypeError:cannotreadproperty'innerHTML'ofnull这是导致问题的行:varidPost=document.getElementById("status").innerHTML; 最佳答案 varidPost=document.getElementById("status").innerHTML;您的网页中不存在“状态”元素。因此document.getElementById("status")返回null。虽然您不能使用NULL的innerHTML属

javascript - 未捕获的类型错误 : Cannot read property 'focus' of undefined

此问题在我的页面加载时发生。使用以下脚本-jquery.simplemodal-1.4.3.js-jqueryv1.7.1下面是一个小代码快照,是发生此错误的simplemodal内的代码。focus:function(pos){vars=this,p=pos&&$.inArray(pos,['first','last'])!==-1?pos:'first';//focusondialogorthefirstvisible/enabledinputelementvarinput=$(':input:enabled:visible:'+p,s.d.wrap);setTimeout(fun

javascript - 控制台集成 : get number of errors/warnings thrown?

所以如果你打开检查器,你会得到这个(如果你不走运的话):我正在构建一个显示调试信息的微型JS组件-有什么方法可以读取到目前为止遇到的错误和警告的数量吗?我想出的一个hacky解决方案涉及一些技巧,用我自己的函数替换console.(error|log|warn)函数,但我还没有测试它是否有效对于所有情况(例如,在我拥有的代码之外)。有更好的方法吗? 最佳答案 如this回答中所述,更改native对象/方法的行为通常不是一个好主意。但是,以下代码应该以一种相当无害的方式为您提供所需的内容://AddthisIIFEtoyourcod

javascript - Typescript "Cannot assign to property, because it is a constant or read-only"即使属性未标记为只读

我有以下代码typeSetupProps={defaults:string;}exportclassSetupextendsReact.Component{constructor(props:any){super(props);this.props.defaults="Whatever";}尝试运行此代码时,TS编译器返回以下错误:Cannotassignto'defaults'becauseitisaconstantoraread-onlyproperty.deafualts是只读属性,但显然没有这样标记。 最佳答案 您正在扩展R