Let me set the stage for this post first. Peergroups.be, the sharing economy website I develop for the non-profit WijDelen, is based on ASP.NET MVC. So I have a bunch of Controller classes with methods that end with return View(model);. Our first goal was to have a web application running as quickly as possible. Now that we have a stable system with active users, we’re looking into writing a mobile app. The mobile app can have the same pages/screens as

I’ve recently been adding Knockout to an ASP.NET MVC application. I would consider Knockout a previous-generation solution and would prefer to use a full-fledged SPA framework like Aurelia, but that’s a bit out of scope for the moment. After introducing Knockout, I wanted to add unit tests on my viewmodels with Mocha. I had some trouble at first, and read quite some answers on StackOverflow that claimed you need a browser. Because you’d want to run the tests from a

In my previous post, I outlined how to use ASP.NET MVC and Angular together, making certain views pure MVC and others Angular. When I first used Angular this way, I was so happy, I went the full Angular way making requests from Angular for my data. Essentially, something like this: $http({ method: ‘GET’, url: ‘/api/rest/’ }) .success(function (data, status, headers, config) { vm.names = data; }) .error(function (data, status, headers, config) {}); This is code inside my customers.js. It’s just

Angular is a great tool, but it took me some time to find a way to combine it elegantly with ASP.NET MVC. This is basically how I did it. First, create a new ASP.NET MVC application. Next, install the Angular package via NuGet. Now for the customization. The objective is to use the normal ASP.NET MVC navigation, unless for certain URLs, when we’ll let Angular take over. So http://www.example.com/Account/Login would be handled by ASP.NET (“ASP.NET-mode”), but http://www.example.com/#/Customers would be handled