'How to handle dynamic pricing plan table in angular?

I have an app where there are four types of plans a user can buy. These plans come from the backend and after selecting a plan, the user is navigated to a page where payment is handled. This pricing table page can be viewed again but if the user has bought any plan, the button text will be changed to cancel subscription. Now I can change button text dynamically for all the other plans but if the user cancels a subscription, I do not know how to handle this dynamic button text logic.

There is a stackblitz linked but since the data is coming from the backend I cannot properly demonstrate the functionality. stackblitz

I just need a way to change button text back to 'Choose Plan' after the user cancels a plan.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source