title: multiple elements with ng-if and always only 1 of them is shown, can they share the same id?
body: <p>As in title. I want to have 2 elements with ng-if and the same id, only 1 of them is shown at the same time. I am wondering if they can have the same id, since ng-if will remove 1 of the elements, so there will be only 1 element with that id. </p>
  
  <p>I mean not only if it can be done, but also if it's a good way of doing things.</p>
  
  <p>Here is the code sample of what I have in mind (it's been simplified):</p>
  
  <pre><code>&lt;span id="elementType" ng-if="vm.type === 1"&gt;type1&lt;/span&gt;
  &lt;span id="elementType" ng-if="vm.type === 2"&gt;type2&lt;/span&gt;
  </code></pre>
  
  <p>Let's say that vm.type can only have values of 1 and 2.</p>
  
  <p>Edit: Using a class instead of id is not possible for me. I am just wondering if I can use a single id for every element, or do all of them need to have separate id.</p>
  
  <p>Edit2: I cannot use a class and need ids because I make these changes for tests, which rely on testing by ids. I cannot change that, so <strong>using class is not an option</strong> for me and is not an answer to my question at all.</p>
  
  <p>Edit3:  I am also absolutely sure that <strong>there will always be only one of the elements</strong> with ng-if displayed. I only need it for displaying element type, and there will always be exactly one type. If by any chance, the requirements change, it would already require massive changes, compared to which, changing things like displaying of the element type is not a problem at all.</p>