我在使用角度为2的JSON.stringify函数将组件引用转换为字符串时出错。我通过以下代码获取组件的引用:
const factor=this.resolver.resolveComponentFactory(DisplayTextAreaComponent);
const componentRef = this.entry.createComponent(factory);
我得到的错误是将循环结构转换为JSON。在下面的图像链接中,我首先完成了console.log(componentRef),然后显示错误。此图像中显示错误:
看看this答案,它可能会帮助你,也教育你什么循环结构:)。