English 中文(简体)
Angular - Error rangeError: Maximum calls ack amount over. 在将不同的“未加保留”从“总价值变化”订阅中删除之后
原标题:Angular - Error RangeError: Maximum call stack size exceeded. after removing distinctUntilChanged() from a fromControl value change subscription

I have two angular components a parent and a child, both with their own form fields. I setup change listeners in both components to listen to the form control value changes and disable some fields upon typing in some form controls.

在试图使构成部分2内的表格控制从构成部分1的变听器中分离出来时,形式控制不是残疾的,而是在打字第二大字之后丧失能力。

在进行了一些研究之后,我发现,在我的变革听众订阅中使用独一无二的“UntilChanged()”是原因。 但是,从订阅中删除独一无二的“UntilChanged()”这一主要问题,现在造成以下ole误: ERORR: rangeError: Maximum calls纳克/立方米以上。


changeListener(){
        this.myForm.get( sample_control_name ).valueChanges.subscribe(v => { 
            if(isNotEmpty(v)) {
                this.childComponent.getFormGroup().get( sample_control_name_1 ).disable();
            } 
            else {
                this.childComponent.getFormGroup().get( sample_control_name_1 ).enable();
            }
        })
}
问题回答

It seems you ve essentially created a loop. The valueChanges observable will emit when you call enable or disable. Here is the relevant section from the Angular Docs: enter image description here

您可尝试在您的劝说中添加<条码>---emitEvent:不实><>/条码”,并应加以确定。





相关问题
Returning data to Forms without opening a new instance

I am trying to return some data from Form2 to Form1, everything seems fine, I got the data and so, but, when I try to pass my data to a textbox, it doesn t changes the text. Only if I open a new ...

Black margins appear when expanding form?

Create a .net 2.0 Windows form app, add a splitContainer docked Fill, with this in its form constructor: public Form1() { InitializeComponent(); for (int i = 1; i <= 300; i++) { ...

Form move events in Windows Forms

My problem is the following: i have a state machine inside an app and i need to be able to pause the current states s ProcessInput function as long as the user moves the form along the screen. I ...

How to dock a windows form in C#?

I just would like to know if it is possible to dock a windows form on top of the user screen? I have been trying to do this by manually setting the position of my form to the coordinates I want. But ...

Prevent window redraw when resizing c# windows forms

What windows message or event can i listen to in order to stop a window from being redrawing every pixel of it s resize? That is, when a user clicks on the edge of the window and starts to re-size ...

Angular2 - cannot change input type dynamically

I was wondering if anyone can help explain why i am unable to change form input type dynamically? For e.g. <user-input type="{{ isActive ? password : text }}"></user-input> doesn t ...

热门标签