[Question] About the decision of use setFormFromSrc() only OnInit and not OnChange on Form lifecycle

未关闭
#1,134 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@Tatsiana8 已经在做这个了。

开始于 2025年4月30日。

评估

这个 Issue 还没有评估数据。

描述

question
Hello guys!

I was implementing some formio tasks at work last friday and we needed to change dinamically between differents Forms. When I changed @ Input() src the component was'nt re-render itself, so I needed to force it manually playing with value based condition and the method detectChanges().

The solution works but this behaviour looked strange to me so I've been reading the source code of "FormioBaseComponent"

lines 284 and 291

and saw that the method that control that "setFormFromSrc()" it's only used OnInit.

Powerful as it is render a Formio Form in our Angulars projects only with the src value, why is it not watched the changes to trigger a re-render? I imagine that there is a good reason, but I can't see it and I'm curious about it!

Thank you in advance :)

主要语言
TypeScript
星标
706
派生
493
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

formio/angular 的其他 Issue

查看 formio/angular 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。