In Aurelia 1, you could access the controller of an Aurelia component by accessing au.controller of an element. In Aurelia 2, there is a better way using the CustomElement.for method, which provided an element with a controller that will return it. You can also access a property on the element if you prefer using: element.$au['au:resource:custom-element'] […]

The post How to Access the Controller and Viewmodel of an Aurelia 2 Component appeared first on I Like Kill Nerds.