#Delete a p-card when pressing a button
7 messages · Page 1 of 1 (latest)
Show the .html template not your UI
We don't get any information how your code works from only the UI
How do you create your row?
Do you push a new item to an array?
If yes, then you can add an ID to each item and assign its ID as a parameter to a function on the clear row button, so when the button is clicked, it will remove the item from the array.
I create my row, by clicking add row button and that button adds a random number in an array, and the p card are displayed with the help of an ngFor, and I itterate trough the random numbers array
so in that case, what you need to do is to pass that generated number as an argument to a function on the clear row button, so that when clear is clicked, it will remove the number from the array.
Note: if you are using
Math. randomto generate that number, I would advise using a random unique ID instead.
Ty 😄