草庐IT

property_types

全部标签

javascript - 尝试使用 gh-pages 部署我的 React 应用程序但收到此错误消息 : The "file" argument must be of type string. Received type undefined

我试图用gh-pages部署我的React应用程序,但我遇到了这个错误:"file"参数必须是字符串类型。接收类型未定义。起初,我以为这是我的代码,所以我制作了另一个没有修改的create-react-app,尝试使用npmrundeploy命令进行部署,但再次收到此错误消息。我的package.json(我添加了我的homepage链接、predeploy和deploy脚本,以及gh-页面依赖):"name":"test-deploy","version":"0.1.0","private":true,"homepage":"https://vnsteven.github.io/te

javascript - 错误 TS7017 : Index signature of object type implicitly has an 'any' type in form validation angular 2

我在给出的Angular2中进行响应式(Reactive)验证时遇到编译错误errorTS7017:Indexsignatureofobjecttypeimplicitlyhasan'any'type为了this.comErrors[field]='';constmessages=this.validationMessages[field];this.comErrors[field]+=messages[key]+'';它正在按应有的方式运行,但是当我尝试运行npmrunbuild.prod时,出现错误并且无法构建我的项目这是我的代码:onValueChanged(data?:any)

javascript - IE 11 浏览器错误 - 异常 : Object doesn't support property or method 'matches' , 其他浏览器工作正常

就我而言,该网页在firefox和chrome浏览器中运行良好,但在IEv.11中它显示错误为errorcomesinIE11DEVELOPERTOOLS.该错误显示在IE11的开发人员工具中。该错误不允许打开特定链接,单击它会显示以下错误。polyfills.ts-*BROWSERPOLYFILLS*//**IE9,IE10andIE11requiresallofthefollowingpolyfills.**/import'core-js/es6/symbol';import'core-js/es6/object';import'core-js/es6/function';impo

javascript - 错误 TS2315 : Type 'ElementRef' is not generic material angular

在项目中添加AngularMaterial时出错ERRORinnode_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(136,20):errorTS2315:Type'ElementRef'isnotgeneric.node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(154,104):errorTS2315:Type'ElementRef'isnotgeneric我正在尝试安装MaterialDesign,但

javascript - 错误 :InvalidValueError: setCenter: not a LatLng or LatLngLiteral: in property lat: not a number

functioninitAutocomplete(){varlat=document.getElementById('lat').value;varlng=document.getElementById('lng').value;console.log(lat);console.log(lng);varmap=newgoogle.maps.Map(document.getElementById('map'),{center:{lat:lat,lng:lng},zoom:13,mapTypeId:'roadmap'});}它给了我以下错误:error:InvalidValueError:

javascript - 自定义过滤器在 AngularJS 中给出 "Cannot read property ' 切片' of undefined"

我的自定义startFrom过滤器给我一个错误。app.filter('startFrom',function(){returnfunction(input,start){start=+start;//parsetointreturninput.slice(start);}});app.controller("PostCtrl",function($scope,$http){$scope.currentPage=0;$scope.pageSize=10;$scope.hidePagination=true;$scope.search=function(){$http.get('some

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

我正在尝试使用.getElementsByTagName()选择元素。vartags=document.body.getElementsByTagName("*");当前尝试使用从现有答案中吸取的教训https://stackoverflow.com/questions/7410949/javascript-document-getelementsbyclassname-compatibility-with-ie/7410966#7410966但是我的尝试失败了,出现了这个错误:UncaughtTypeError:Cannotreadproperty'getElementsByTagN

javascript - Swagger 'GET' 请求总是以 text/html 形式返回 Accept type on response 而不是 application/json

我有一个使用SwaggerUI的swagger标签文档,它总是返回text/html但它应该返回application/json。POST请求和所有其他类型都返回application/json但这个特定的GET请求不会。服务端点代码正确。如果我将请求更改为POST,它会作为application/json返回。所以它只是在swagger中键入GET,它不会返回正确的类型。有没有想过如何更正UI中的调用以使用application/json?这是最近从swagger站点下载的swagger版本2.1.4。"/bankName":{"get":{"summary":"BankNameSe

javascript - 是否可以通过鼠标单击 <input type=text> 元素来 dispatchEvent()?

基本上,我尝试使用以下代码将自定义的鼠标单击事件分派(dispatch)到文本输入元素(参见jsFiddle):functionsimulateClick(id){varclickEvent=document.createEvent("MouseEvents");clickEvent.initMouseEvent("click",true,true,window,1,0,0,0,0,false,false,false,false,0,null);varelement=document.getElementById(id);element.dispatchEvent(clickEvent

javascript - 类型错误 : Cannot create property 'validator' on string 'abc@gmail.com' at setUpControl

我在formGroup中遇到问题。首先,我根据URL取一些值并调用API来检索前字段文本的特定用户数据。注册.htmlUsername注册.component.tsimport{Component}from'@angular/core';import{FormGroup,AbstractControl,FormBuilder,Validators}from'@angular/forms';import{Router,ActivatedRoute}from'@angular/router';import{EmailValidator,EqualPasswordsValidator}fro