New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ControlValueAccessor's interface methods are not unbind after element detached. #28039

Open
johnny-mh opened this Issue Jan 10, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@johnny-mh
Copy link

johnny-mh commented Jan 10, 2019

馃悶 bug report

Affected Package

The issue is caused by package @angular/forms

Is this a regression?

No.

Description

Despite of component that implements ControlValueAccessor was detached by *ngIf directive, It's interface methods are called several times.

馃敩 Minimal Reproduction

https://stackblitz.com/edit/angular-issue-repro2-snxdyy

馃敟 Exception or Error

When click 'reset' button. there is one InputComponent in the form. but writeValue called printed 4 times.

Detached component's methods are invoked.

馃實 Your Environment

Angular Version:



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / 鈻 \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 7.1.0
Node: 10.13.0
OS: darwin x64
Angular: 7.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.10.7
@angular-devkit/build-angular     0.10.7
@angular-devkit/build-optimizer   0.10.7
@angular-devkit/build-webpack     0.10.7
@angular-devkit/core              7.0.7
@angular-devkit/schematics        7.1.0
@ngtools/webpack                  7.0.7
@schematics/angular               7.1.0
@schematics/update                0.11.0
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.19.1

Anything else relevant?

None.

@ngbot ngbot bot added this to the needsTriage milestone Jan 10, 2019

@longgt

This comment has been minimized.

Copy link

longgt commented Jan 11, 2019

Duplicated with #20007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment