Closed thde closed 7 years ago
@thde
Current Url: Use [routerLink]=""
instead of href
.
Toggling class for a specific element: You need to have a variable or condition to differentiate the state.
Instead of having one attribute saved: boolean
, I would use an array isPaid: boolean[]
.
Then you can use the [ngClass] directive as shown below.
[ngClass]="{'success': isPaid[i]}"
One more thing. At the beginning, all buttons have the text paid
. I would change it to pay
. Just when you click on pay
, the state should be changed to paid
. It can also be done with the isPaid
array.
@thde only i can do that :D
@tk-codes both worked. thanks!
@tk-codes & @lroellin please review
@tk-codes looks great. thanks
@tk-codes could you help me with toggeling a class in suggested payments? currently all classes are toggeled when clicking on "Paid". Although only the clicked element should be toggeled.
@tk-codes Do you know how I can link to the current URL on the dashboard?