How would you go about accessing a DOM element in Aurelia? This is a broad and general question, but I have a feeling there are one or two preferred ways to do this. I have
As Rob suggested, use ref. For your example:
ref
view
viewModel
class ViewModel { canDeactivate() { var form = this.myForm; // do stuffs } }
For more information on the ref attribute, see here: http://aurelia.io/docs/binding/basics#function-references