Since a post can’t be empty, I’ll include the question in the header: Is there anything in Aurelia v.1 that wraps ‘document.getElementById’?
TIA
Since a post can’t be empty, I’ll include the question in the header: Is there anything in Aurelia v.1 that wraps ‘document.getElementById’?
TIA
What’s wrong with using document.getElementById
?
Who said there’s is something wrong with calling getElementById
? I’m just curious as to whether Aurelia “wraps” these things or not.
There is no wrapper on top of native selector APIs. No benefit would be added by doing so.
This is not a wrapper, but try reading about http://aurelia.io/docs/binding/basics#referencing-elements
When I started with Aurelia I was using jQuery to reference the elements within my View Models. ref=“namedElement” exposes (binds) the element to the View Model so you just use it. Once I understood that I stopped using jQuery or getElementById (though I was too far by then to refactor it out of my first too apps).
Hope this helps.
@Inawire I’ve been away from Auralia for a long time and had forgotten about the ref
. Works like a charm. Thanks for your help.