I have a small angular app going and I'm stuck on something that seems so simple! (New to angular here).
Scenario: I have two buttons on the page that should toggle the display of their associated content.
Few things need to happen:
Buttons: 1. Should be an active button on page load (also displaying its appropriate content) 2. When other button is clicked, this should change the active state (for button and associated content) 3. If active button is clicked, nothing should happen. It should stay active.
Can't figure out how to do this. All help is appreciated.
Code
<div class="toggle-btns">
<button class="toggle-btns__btn toggle-btns__btn--active">Button 1</button>
<button class="toggle-btns__btn" >Button 2</button>
</div>
<div class="content-one">
<!-- content here -->
</div>
<div class="content-two">
<!-- content here -->
</div>