Assuming you have already set up the HTML structure, the process is quite simple.
Here is what you need to do:
In your app.component.ts (or whatever your component is named), define a variable like this:
title: string = 'Replace this text with dynamic content after clicking Learn more'
You can customize the text as needed since it will be updated dynamically.
Next, create three functions similar to the following:
function1() {
this.title = 'Button 1 clicked'
}
function2() {
this.title = 'Button 2 clicked'
}
function3() {
this.title = 'Button 3 clicked'
}
Simply change the text within the '' accordingly.
Now, in your app.component.html (or equivalent component file):
Find the specific text, likely within an h1, and replace it with:
{{ title }}
Finally, for each button, add the following:
<button (click)="function1()">Learn more</buton>
<button (click)="function2()">Learn more</buton>
<button (click)="function3()">Learn more</buton>
With these steps completed, you're all set.