Expression changed after it was checked,when setting initial value for control.

Hi,
When i set intial value of control and comapring that value as condition to display valueTemplate.

paybyDateData = [
{ text: '1 Month', value: 1 },
{ text: '2 Months', value: 2 },
{ text: 'Custom', value: 'Custom' },
];
Error:

could you please help me with this.

3 Replies 1 reply marked as answer

JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team March 22, 2021 06:57 AM UTC

Hello Goutham, 

Greetings from Syncfusion support. 

We have checked the reported issue and the cause of the issue is due to manipulating the DOM directly with template. Angular will not detect these changes and react properly always. To get rid of the issue, we suggest you to detect the changes explicitly as mentioned below code example. 

Please find the sample in the below link.

Sample Link       : https://stackblitz.com/edit/angular-a1gm6h 

Code Snippet     :


 
constructor(private cd: ChangeDetectorRef) {  
         
      }

  
    ngAfterViewChecked(){  
        this.cd.detectChanges();  
    }  



Kindly integrate the provided solution in your application and get back to us if you need any further assistance on this. 

Regards, 
Jeyanth. 


Marked as answer

GO Goutham March 23, 2021 09:59 AM UTC

Thank you so much ,its working.


JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team March 24, 2021 06:45 AM UTC

Hi Goutham, 

We are glad to hear that your issue has been resolved. Please let us know if you need any further assistance on this. 

Regards, 
Jeyanth. 


Loader.
Up arrow icon