We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

items of tool bar not removed from DOM after destroying toolbar component where items of toolbar are rendered via template prop(id is attached to template property))

Thread ID:





146588 Aug 9,2019 07:40 AM UTC Aug 13,2019 09:30 AM UTC Angular - EJ 2 1
Tags: Toolbar
Asked On August 9, 2019 07:40 AM UTC

 We have used toolbar component ,and item of toolbar are rendered using template property(id of element is given as value) as shown below.

Html part:

Ts file part:

Why i used this type of rendering:
Using this type configuration,we are showing/hiding toolbar items dynamically depends upon logic.
Every time ,we navigated away from  route which containing toolbar,the items are appended to DOM ,not removed from DOM when route (component which containing toolbar ) is destroyed.

Thank you.

Karthigeyan Krishnamurthi [Syncfusion]
Replied On August 13, 2019 09:30 AM UTC

Hi Goutham, 
Syncfusion greetings. 
Kindly use ng-template option to achieve your requirement and the below sample is made for your reference. 
<ejs-toolbar height="60" #element width="100%"> 
      <ng-template #template> 
        <ejs-numerictextbox value="10"></ejs-numerictextbox> 
      <ng-template #template> 
      <ng-template #template> 
        <button class='e-btn'>Template</button> 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon