This is a migrated thread and some comments may be shown as answers.

Bind "showText" via ngTemplateOutlet

3 Answers 18 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Veteran
Iron
Michael asked on 13 Jan 2021, 04:19 PM

Hi! I have the following example and i want to bind the "showText" property to the let-showTextValue from ng-template.

 

https://stackblitz.com/edit/angular-3cew1n?file=app/my-toolbar.component.ts

3 Answers, 1 is accepted

Sort by
0
Accepted
Svet
Telerik team
answered on 15 Jan 2021, 12:39 PM

Hi Michael,

Thank you for the provided example.

The demonstrated undesired behavior is caused by a bug on our side. That is why I logged an issue in our public GitHub repository on this matter:

https://github.com/telerik/kendo-angular/issues/3178

Please track the issue status for any further updates on it. 

What could be done as a workaround until the issue is resolved is to re-render the ToolBar component using the *ngIf directive every time the showText property value is changed. Indeed such approach has its drawbacks that the complete ToolBar will have to be re-rendered and there will be short blinking, but there isn't another approach that I can suggest until the issue is resolved. Please see the suggested workaround at the following example:

https://stackblitz.com/edit/angular-dqplxr?file=app/app.component.ts

I have also updated your account Telerik points for raising our attention to this issue.

Please let me know in case I can provide any further information on this case. Thank you. 

 

Regards,
Svetlin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Michael
Top achievements
Rank 1
Veteran
Iron
answered on 22 Jan 2021, 09:54 AM

Hi Svetlin,
thx for your replay and the issue logging. 
The workaround you mentioned is not working for me! I get the error message:

ViewDestroyedError: Attempt to use a destroyed view: detectChanges

 

I have edited the Stackblitz: https://stackblitz.com/edit/angular-3cew1n?file=app/app.component.html

Do you have any idea what i can do?

 

0
Svet
Telerik team
answered on 26 Jan 2021, 07:23 AM

Hi Michael,

Thank you for the provided example.

The demonstrated error is generic to the Angular framework and isn't related to the specific functionality of Kendo UI for Angular. It suggests that the Angular change detection looks for changes in the component which has been earlier destroyed. Please check some of the online available resources on this matter:

https://stackoverflow.com/questions/44140404/viewdestroyederror-attempt-to-use-a-destroyed-view-detectchanges

https://stackoverflow.com/questions/56056911/attempt-to-use-a-destroyed-view-detectchanges-event-though-the-view-is-detached

what could be done is to use onPush change detection strategy so that the change detection cycles are manually initiated. I hope the suggestions help. Please let me know in case I can provide any further information about this case.

Regards,
Svetlin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ToolBar
Asked by
Michael
Top achievements
Rank 1
Veteran
Iron
Answers by
Svet
Telerik team
Michael
Top achievements
Rank 1
Veteran
Iron
Share this question
or