AngularJS Radio Track by Directive

In this post I'll explain and demonstrate a directive I've written which allows you to use similar behaviour of the "track by" options we are given in select lists in AngularJS with radio buttons. AngularJS does change tracking on any object which is assigned to a scope. Every time it examines our objects and looks for changes is called a "Digest Cycle". AngularJS uses "dirty checking" to check if our objects have changed. In an »

AngularJS text filter (with C# string.format() syntax)

If you've read a few posts from my blog you'll probably see that I've done a bit of work in the .Net world. My day job requires me to use the .Net Framework for server side programming. I've spent a lot of time using C# and enjoy the language. I've also been doing a lot of work in the JavaScript (front-end) world recently. Primarily using the AngularJS framework. By the end of this post you'll »

$q.all() - Combining promises in AngularJS

Using $q.all() in AngularJS couldn't be simpler. $q is an Angular Service which facilitates running functions asynchronously. It's based on a library (Q) by Kris Kowal. $q.all() allows us to wait on an array (or object) of promises, $q.all() will combine these into a single promise. One Promise The returned promise abides by the following two rules: If one promise in the array fails, the combined promise fails If all promises succeed, »

AngularJS putting a template in the $templateCache

This is a quick post about getting a template in the $templateCache. A SPA (Single Page Application) I'm building at work, consists of 4 "views". We expect the users to be on this page for a good while (anything from 5 mins upwards). The threat of losing internet connectivity is a real one and would render our application useless (we regularly call out to a JSON API to update results on the user's request). I've »