Enabling Dependency Injection for client side models bound to Aurelia enhanced razor views

As the example for this post I’ve decided that this page needs access to the Aurelia Router. The reason for this could for example be some interaction in the page where you’ll need to navigate the user away to some other route of the application. What we need to achieve is a version of the HomePersonClientModel that looks somewhat more like this:

Connect the markup to a client side model when aurelia enhancing the server side rendered razor view

Our next step in creating this ASP.NET Core MVC/Aurelia hybrid application is to take the Aurelia enhancement of the razor views one tiny step further. In the previous post we made it possible to use any built in and custom aurelia attributes and elements within the razor views by "aurelia enhancing" the html we got back from the server. But what we didn't do in our enhance call is to include a model object that the markup can interact with through aurelia data and event bindings.

Why Aurelia?

Before continuing my endeavour to share how I’ve “hybrided” together ASP.NET Core MVC and Aurelia I’d like to share just a few words and some links on why I decided to go with Aurelia. Some background is that late fall 2016 I decided it was time to move from my current work position and what