I was wondering how to tag my Angular app with ARIA attributes per the WAI-ARIA specification. Suppose I had the following template,
<div id="no-1" *ngIf="some_condition">some text</div>
<div id="no-2" *ngIf=!some_condition">some other text</div>
<button (click)="some_condition = !some_condition">switch</button>
What is the proper way to tag these elements with ARIA attributes? It's my understanding *ngIf removes the element from the DOM altogether, so is an aria-hidden necessary on either of the divs? Neither element will be present in the DOM when aria-hidden is true, so it seems pointless. I'm not sure if it helps screen readers, though, so I want to be sure.
Second, since both divs fill the same position in the DOM based on the value of some_condition, should they both have the same ID? And should the button have an aria-controls that refers to that ID? If not, how do I specify the relationship between the divs and the button?