The RAW stack and filtering movies by genre

One of the options on the movie list was a set of buttons with each movies genres. This list is nice to see what a movie is about but also rather useful to filter movies on. It turns out filtering documents on one or more tags in a collection of tags is rather easy to do using RavenDB.   Using RavenDB’s LuceneQuery RavenDB uses Lucene for it’s indexing capabilities making it very capable for querying. Originally we where using the standard RavenDB query capability but now we will switch to using the LuceneQuery(). Form the AngularJS client we can pass … Continue reading The RAW stack and filtering movies by genre

Paging data using AngularJS and RavenDB in the RAW Stack

So far loading and displaying some movies data has been pretty simple and straightforward. However something that was not immediately apparent was that not all movies in the database where shown. When opening the movies list there where just 128 movies visible and that was not all there was to show. In fact I have used the Rotten Tomatoes API to preload the database with more than 1000 movies and even though I never added a filter anywhere most of these didn’t show up. So what is going on?   RavenDB = Safe by default RavenDB really is an awesome … Continue reading Paging data using AngularJS and RavenDB in the RAW Stack

Unit testing AngularJS HTTP requests in the RAW Stack

In the previous blog post we created some basic unit tests for the AngularJS movies controller. As I mentioned there was one set of tests missing and that was around the controller doing HTTP requests to the WebAPI backend. In a unit test typically don’t want to do those test for real. First of all we don’t want to take a dependency on some external state and equally important we don’t want the overhead of those requests. Fortunately AngularJS makes it easy to fake those requests and test the controller bits in isolation.   The $httpBackend service One of the … Continue reading Unit testing AngularJS HTTP requests in the RAW Stack

Unit testing the AngularJS code in the RAW Stack

In the previous post we refactored the JavaScript code for our AngularJS controller a bit to make it more testable. However we didn’t actually start writing any tests yet so lets create a few tests.   The AngularJS controller under test Just as a quick reminder the AngularJS controller in our previous code was as follows 1: (function () { 2: ‘use strict’; 3: var module = angular.module("myApp", []); 4:  5: module.controller("moviesCtrl", function ($scope, $http) { 6: $http.get("/api/movies").then(function (e) { 7: $scope.movies = e.data; 8: }); 9: 10: $scope.newMovie = { Title: "" }; 11: $scope.addMovie = function () { … Continue reading Unit testing the AngularJS code in the RAW Stack

Refactoring the AngularJS code in the RawStack

In the previous post I created a minimal skeleton app to pass some movie data from RavenDB through a WebAPI endpoint to an AngularJS frontend and also to save new movies back to RavenDB. The code was, as I mentioned in that post, really minimal and by no means a good way of writing it. So in this post I am going to improve on the AngularJS part. It still will not be perfect but better.   Inline JavaScript There are cases where inline JavaScript mixed with you markup makes sense but as a general rule it should be avoided. … Continue reading Refactoring the AngularJS code in the RawStack

Creating a basic skeleton with the RAW stack

When I start with a new stack one of the first things I always do is create a really simple app to do something sort of meaningful. So lets do that with the RAW stack.   Just as a reminder the RAW stack is a combination of RavenDB, AngularJS and WebAPI. These three technologies combined make a pretty awesome combination for a developer wanting to make smart client side web applications and is using .NET on the server.   As the demo application I will be building is all about movie reviews and rentals lets start my a very minimalistic, … Continue reading Creating a basic skeleton with the RAW stack

Introducing the RAW stack

With this post I am introducing the RAW stack. Why the RAW stack? Well it is kind of the equivalent of the MEAN stack. Not that there is anything wrong with the MEAN stack, quite the opposite, but being a .NET developer I really like to keep using .NET where it’s strengths lie and where it is suitable. Now there are plenty of places where it isn’t but C# on the server is still quite awesome.   So what is the RAW stack? Basically the RAW stack consists of three parts. RavenDB AngularJS WebAPI   Why these three? RavenDB Well … Continue reading Introducing the RAW stack

Showing AJAX activity in a AngularJS application

  Showing some kind of AJAX busy indicator is a common thing in web applications. However it is something you don’t want to do with every AJAX start and end of request. First of all writing all that code would be quite tedious but more importantly the might be multiple overlapping requests ongoing at the same time. And in a case like that you only want to show the AJAX busy indicator at the first request and more importantly hide it only when the last of the requests has finished. Fortunately AngularJS has some nice integration points allowing us to … Continue reading Showing AJAX activity in a AngularJS application