NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.87k stars 3.93k forks source link

nz-form-control 通过 ng-template 引入的 input 无法监听 statusChange #7610

Open msyesyan opened 2 years ago

msyesyan commented 2 years ago

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-ivy-xxx4jz?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.module.ts

Steps to reproduce

  1. Demo 中提供了一个 required validator 的 input
  2. 正常输入, 再删除键删除内容
  3. 发现通过 ng-container 动态 render 的 input 没有状态变化

What is expected?

希望能支持 ng-template, 希望能有状态变化。

What is actually happening?

没有状态变化

Environment Info
ng-zorro-antd 13.4.0
Browser Chrome
zorro-bot[bot] commented 2 years ago

Translation of this issue:

NZ-Form-CONTROL cannot be nested NG-Container

REPRODUCTION LINK

[https://stacktackzblitz.com/edit/ng-zorro-nTd- ix4jzfile=src%2FAPPP.comPonent.ts, src%2fapp.com COM/EDIT/NG-Zorro-ATD-Ivy-XXX4JZ? File = SRC%2FAPP%2FAPP.comPonent.ts, SRC%2FAPP%2FAPP.MODULE.TS)

STEPS To Reproduce

  1. Demo provides an input of Required Validator
  2. Normal input, delete the key to delete the content
  3. I found that the input of the NG-Container dynamic render has no state change

What is exfected?

I hope to support NG-Template, and I hope to have a state change.

What is actually happy?

No state change

ENVIRONMENT Info
NG-Zorro-ATD 13.4.0
Browser Chrome
msyesyan commented 2 years ago

@simplejason https://github.com/NG-ZORRO/ng-zorro-antd/commit/98ac620a1eac4e307505450fbf7890f5b3da20ff#diff-8e82afd43f98e49a4ceca034b0ef7bd5a113b3a2eb768a7650c000aa1c01ad36

May I know why should we do this change? we have used a lot of nested nz-form-item and ng-template, and this change bring us disaster