I notice that when Ionic renders the same template (for multiple views), I am forced into a situation where I have multiple elements of the same html id.
Hence, if I just plainly use document.getElementById(id)
, I find myself in situations where I do not get the element I want.
(I want the element inside the current rendered view, and not the element inside the template of some other view currently the user is not in)
How should I get around this? Is there a way to get an element from within the boundaries of the current view being rendered?