Getting Started with React & ES6

Feeling like having a go with Facebook’s hugely popular React framework but not sure where to start? In this post I’m going to build a simple React application from scratch - using ECMAScript 6. We’ll put together the bare minimum skeleton of a site and keep the folder structure free of noise and clutter so that you can focus on the app code and not the tooling! The simple app we’ll build is at github.
Read more

Manipulating JSON Web Tokens (JWTs)

I’ve been writing a couple of web services lately that use Auth0 for identity management. It’s a great platform that makes working with different identity providers a breeze. One thing that I couldn’t work out how to do at first was to quickly build a new JWT1 from an existing token. I wanted to take my current token, add some more data to it and return it to the user. So here’s a ‘why’ and ‘how’.
Read more

The Best Module System for AngularJS Applications

I was working on a small and simple application built with AngularJS the other day. As with most applications like this, I start with a single JavaScript file caled app.js and no module system. In the past I’ve used RequireJS with AngularJS. It’s an awful mistake. It leads to a big jump in complexity with no benefts. Angular apps don’t work well with AMDs, so really your are using RequireJS to combine files into one big file.
Read more

Failures Connecting from Elastic Beanstalk servers to MongoDB on EC?

tl;dr? Check your mongodb.conf bind_ip settings to make sure that you’re not allowing connections only from localhost. This may just end up being the first part of a wider troubleshooting guide, but this is one I’ve spent a few hours fixing, after assuming I was making terrible mistakes with my security groups. If you find you cannot connect to your MongoDB server from an EB app server (or anything for that matter), before you spend ages checking your Elastic IP, VPC and Security Group config, don’t forget that you may have simply used bind_ip in your config file.
Read more

Fixing Memory Leaks in AngularJS and other JavaScript Applications

Dealing with memory leaks in JavaScript applications can be a complex process. In this article I’m going to show you how to identify whether you have memory leaks, analyse them and ultimately resolve them. I’m using an AngularJS application to demonstrate the concepts and approaches, but much of this material applies to any JavaScript application. Understanding Memory Leaks What is a Memory Leak? Why is a Memory Leak Bad?
Read more

The Only AngularJS Modal Service You'll Ever Need

If you need modals in an AngularJS application, look no further. I’ll show you how to use the Angular Modal Service to add Bootstrap Modals or your own custom modals to your application. See it in a fiddle or check out a full set of samples online. Contents [Using the Angular Modal Service](#UsingTheAngular ModalService) A Quick Example Design Goals How It Works Wrapping Up Using the Angular Modal Service Here’s how you can use the Angular Modal Service to add a bootstrap modal to your application.
Read more

Practical AngularJS Part 2 – Components of an AngularJS Application

Welcome to Part 2 of Practical AngularJS. I’m going to introduce you to some of the core components of an angular app. These are: Controllers Filters Directives Services Views & Routes We’re not going to be going into detail – just taking a look at what each of these components are and where they fit into the structure of an app. We’ll be going into detail for each of them in later articles.
Read more

Practical AngularJS

This series focuses on building applications with AngularJS. It assumes no prior knowledge. Part 1 – Introducing AngularJS What is AngularJS? What’s it for and when should we use it? We look into the basics of AngularJS – controllers, models and scopes, as well as how to use common directives like ng-model and ng-repeat. We see how client side logic is improved with AngularJS and how we can handle unit testing.
Read more

AngularJS Promises - The Definitive Guide

Promises are a core feature of AngularJS - whether you understand them or not, if you use AngularJS you’ve almost certainly been using them for a while. In this post I’m going to explain what promises are, how they work, where they’re used and finally how to use them effectively. Once we’ve got the core understanding of promises, we’ll look at some more advanced functionality - chaining and resolving promises when routing.
Read more

Better Specifications

Specifications are absolutely key to the success of a project. Unless you have a good definition of what your project is supposed to be, there’s no way you can deliver it. A specification is the contract between you and the client, the basis for technical designs, quality assurance test plans, operational readiness, and much more. I’m not going to talk about how different teams do specs, what works and what doesn’t work.
Read more