Hi
I have below columns data returned. I want if name = actions' then in row 2 button Edit & Delete should be displayed in Angular 17
Columns are displayed like below
1:
name: "description"
title: "Description"
Thanks
Hi
I have below columns data returned. I want if name = actions' then in row 2 button Edit & Delete should be displayed in Angular 17
Columns are displayed like below
1:
name: "description"
title: "Description"
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dharmeshwaran SPosted Jun 27, 2024, 2:29 PM
To display buttons based on a specific condition, you can use Angular's templating features along with conditional logic in your component template. Here’s a step-by-step guide on how to achieve this:
*ngIfto conditionally display the buttons in your template.Step 1: Define the Data Structure
Step 2: Create the Template
In your component's HTML file, use
*ngIfto conditionally display the buttons.Step 3: Define the Logic for Edit and Delete Buttons
In your component's TypeScript file, define the methods for
onEditandonDelete.