我正在尝试使用Angular Elements 8创建一些自定义元素,当在@Input()上将简单对象用作字符串/数字时,它的效果很好。但是,当我想开始使用对象数组时,IE EDGE / 11会引发异常。
程序
克隆仓库(代码github repo)或执行以下操作:
ng新的“名字”
更新浏览器列表以包括IE11
生成简单列表组件
用输入为组件编写代码
提供解决方案(没有我知道的角度元素),一切正常。
添加角元素(添加@角/元素)
修改模块以将引导程序组件作为自定义元素
服务和加载EDGE,请参阅控制台错误
TypeError: Unable to get property 'setInputValue' of undefined or null reference at listItems.set (http://localhost:4300/vendor.js:77430:35) at DefaultDomRenderer2.prototype.setProperty (http://localhost:4300/vendor.js:80310:9) at DebugRenderer2.prototype.setProperty (http://localhost:4300/vendor.js:76553:9) at setElementProperty (http://localhost:4300/vendor.js:73738:5) at checkAndUpdateElementValue (http://localhost:4300/vendor.js:73648:13) at checkAndUpdateElementInline (http://localhost:4300/vendor.js:73576:5) at checkAndUpdateNodeInline (http://localhost:4300/vendor.js:74992:13) at checkAndUpdateNode (http://localhost:4300/vendor.js:74935:9) at debugCheckAndUpdateNode (http://localhost:4300/vendor.js:75957:5) at debugCheckRenderNodeFn (http://localhost:4300/vendor.js:75935:13)"
这是已知的缺陷还是我缺少重要的东西?
这是角度/元素中的缺陷。使用document-register-elements时,polyfill无法可靠地调用构造函数。
要解决问题,请切换到另一个自定义元素的polyfill,例如@ webcomponents / custom-elements
我为您的项目创建了一个分支,并解决了该问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句