angular6 Error:Debug Failure at typeToString解决分析
错误详情
如下:
ERROR in : Error: Debug Failure.
at typeToString (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:28777:22)
at reportRelationError (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:34714:34)
at isRelatedTo (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:34860:21)
at checkTypeRelatedTo (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:34697:26)
at checkApplicableSignature (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:40608:26)
at resolveCall (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41011:17)
at resolveCallExpression (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41163:20)
at resolveSignature (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41398:28)
at getResolvedSignature (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41430:26)
at checkCallExpression (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:41479:29)
at checkExpressionWorker (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:42950:28)
at checkExpression (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:42898:42)
at checkExpressionStatement (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:44962:13)
at checkSourceElement (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:46746:28)
at Object.forEach (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:1506:30)
at checkBlock (F:\work\angular\web-ide\node_modules\typescript\lib\typescript.js:44563:16)
原因分析
我代码里出现这个错误的原因是在定义Map的时候,值为数组类型,但未给数组赋值泛型
如下:
public renderStateMap = new Map<string, []>();
解决方案
只需要给数组添加类型即可:
public renderStateMap = new Map<string, any[]>();
以上就是angular6 Error:Debug Failure at typeToString解决分析的详细内容,更多关于angular6 Error解决的资料请关注脚本之家其它相关文章!
相关文章
Angular2.0/4.0 使用Echarts图表的示例代码
本篇文章主要介绍了Angular2.0/4.0 使用Echarts的示例代码,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2017-12-12angularjs实现table表格td单元格单击变输入框/可编辑状态示例
这篇文章主要介绍了angularjs实现table表格td单元格单击变输入框/可编辑状态,涉及AngularJS事件响应及页面table元素属性动态操作相关实现技巧,需要的朋友可以参考下2019-02-02详解Angular调试技巧之报错404(not found)
本篇文章主要介绍了详解Angular调试技巧之报错404(not found),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2018-01-01Angular组件库ng-zorro-antd实现radio单选框选择
这篇文章主要为大家介绍了Angular组件库ng-zorro-antd实现radio单选框取消选择实现问题解决,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪2023-05-05Angular.js跨controller实现参数传递的两种方法
这篇文章主要给大家介绍了关于Angular.js跨controller实现参数传递的两种方法,文中给出了详细的介绍和示例代码,相信对大家具有一定的参考价值,需要的朋友们下面来一起看看吧。2017-02-02AngularJS通过$location获取及改变当前页面的URL
本篇将介绍AngularJS中的$location服务的基本用法,$location服务的主要作用是用于获取当前url以及改变当前的url,并且存入历史记录。本文通过示例代码介绍的很详细,有需要的朋友们可以参考借鉴,下面来一起看看吧。2016-09-09详解Angular Forms中自定义ngModel绑定值的方式
在Angular应用中有两种方式来实现表单绑定,但是对于一些特殊的表单控件没法实现,这篇文章主要介绍了详解Angular Forms中自定义ngModel绑定值的方式,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2018-12-12
最新评论