Ionic: getting an element from a template with an identifier

I notice that when Ionic displays the same template (for multiple views), I am forced into a situation where I have several elements of the same html identifier.

Therefore, if I just use document.getElementById(id), I find myself in situations where I do not get the item that I want.

(I want the element inside the current rendered view, and not the element inside the template of some other view, the user is not currently located)

How do I get around this? Is there a way to get an element from the borders of the current displayed view?

+4
source share

All Articles