Reputation: 337
I made an Activity tracker that adds activity on clicking Add Activity and deletes all activities on clicking Clear All buttons and displays list of activities with a checkbox. Now what I want is to apply text-decoration: line-through and change the color of the activity text to red when checkbox of that particular activity is clicked. Here is a Working demo and picture of what i m trying to do. I tried several ways to do this but I guess there will be some quick and smart way to do this using ngClass directive(that I m not finding a way to implement). So I am expecting a smart way not classic and lengthy.
Upvotes: 2
Views: 613
Reputation:
Why would you need NgClass
?
Just use CSS.
input[type="checkbox"]:checked+span {
text-decoration: line-through;
color: red;
}
Upvotes: 5