首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >resolver.resolveComponentFactory错误

resolver.resolveComponentFactory错误
EN

Stack Overflow用户
提问于 2016-10-25 22:31:51
回答 1查看 1.9K关注 0票数 0

我正在跟踪这个职位,试图动态创建组件(基于json数据)-

但这段代码:

ngOnInit() { // Create our component now we're initialised let componentFactory = this.resolver.resolveComponentFactory(MyDynamicComponent); this.componentReference = this.dynamicTarget.createComponent(componentFactory); }

生成一个编译错误,名为metadata_resolver.js:508: Uncaught Error: Can't resolve all parameters for MyDynamicComponent: (?).

IDE提示:Argument type MyDynamicComponent is not assignable to parameter type Type<MyDynamicComponent>

我不知道我应该如何使用它并修改我的调用。陷阱是什么?

EN

回答 1

Stack Overflow用户

发布于 2022-06-05 15:27:17

目前版本的Ionic v6.1.8角14不兼容。显然,它已经在开发版本中得到了修正,但还不稳定。请看这里的https://github.com/ionic-team/ionic-framework/issues/25353,您可以将@ionic/angular更新为6.1.9-dev.11654275237.1b595be3版本并重新运行npm install。如果你想站在边缘的话,现在应该工作得很好。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40250806

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档