I'm trying to get Aurelia to use a Razor view(.cshtml) instead of regular .html and the proposed way to do it is to override convertOriginToViewUrl with the appropriate code. In my case a route to the action that returns PartialViews.
import {ViewLocator} from 'aurelia-framework';
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
ViewLocator.prototype.convertOriginToViewUrl = (origin) => {
return "/template?view=" + origin.moduleId;
};
aurelia.start().then(a => a.setRoot());
}
There are some posts about the same subject, Customizing Aurelia to use .cshtml, but it doesn't seem to work for me.
The controller just returns a PartialView which works when you access the route through your browser but when Aurelia tries to use the rout /template?view=app it seems to be trying to access it throught ".//template?view=app" which does not exist.
What am I missing here? Am I supposed to build a whole new ViewLocator? Is it a webpack issue?