Is there a way to create a radio button group using UL and LI elements in Angular2 and Typescript? The goal is to have all the anchors function like a radio button group where only one can be selected at a time. The selected anchor should remain "clicked" until another anchor is selected, providing the user with visual feedback.
I'm new to Angular2 and Typescript, so I'm unsure if there's a built-in feature in Angular that can handle this functionality. In jQuery/JS, I would add a class to each anchor for easy selection, remove the clicked class from all anchors when a new one is clicked, and then add the clicked class to the newly selected anchor. Angular's [routerLink] can take care of the routing part.
The current markup is designed with a jQuery solution in mind because I haven't found a way to remove a CSS class directly in Typescript. While I could control styles through interpolation like [style.color], it would require storing style values for each anchor individually. There must be a simpler approach!
<md-sidenav #start mode="over" class="sideDrawer">
<ul>
<li><a href="#" class="anchor" id="a11" (click)="sideNavAlert($event)">anchor 1.1</a></li>
<li><a href="#" class="anchor" id="a12" (click)="sideNavAlert($event)">anchor 1.2</a></li>
<li><a href="#" class="anchor" id="a13" (click)="sideNavAlert($event)">anchor 1.3</a></li>
</ul>
<ul>
<li><a href="#" class="anchor" id="a21" (click)="sideNavAlert($event)">anchor 2.1</a></li>
<li><a href="#" class="anchor" id="a22" (click)="sideNavAlert($event)">anchor 2.2</a></li>
<li><a href="#" class="anchor" id="a23" (click)="sideNavAlert($event)">anchor 2.3</a></li>
</ul>
<ul>
<li><a href="#" class="anchor" id="a31" (click)="sideNavAlert($event)">anchor 3.1</a></li>
<li><a href="#" class="anchor" id="a32" (click)="sideNavAlert($event)">anchor 3.2</a></li>
<li><a href="#" class="anchor" id="a33" (click)="sideNavAlert($event)">anchor 3.3</a></li>
</ul>
</md-sidenav>