Clean Up Your Code With Custom Promises

Friday, February 6th, 2015

Custom promises can really clean up your code in certain situations. For me, I have found that using custom promises can clean up consumers of my data services and models. I wanted to show a couple examples where I have found them really useful. The following examples use Angular’s $http service, but the same ideas can likely be applied if you are working with another deferred and promise implementation.

Read More

How to Learn Angular.js

Sunday, February 1st, 2015

I get asked pretty frequently, “What is the best way to learn Angular.js?”. Here is a path of resources in order of what I think is a good way to learn Angular.

Read More

Upgrading Jasmine from 1.3 to 2.1

Thursday, January 29th, 2015

Recently I upgraded the unit tests for a work project from using Jasmine 1.3 to Jasmine 2.1. The suite had about 400 tests. When I upgraded, only about 60 tests broke due to Jasmine API changes. Here are some of the differences I found between Jasmine 1.3 and Jasmine 2.1. The process took me about 2 hours. Hopefully this post will make the upgrade path a little faster for someone else.

Read More

Mocking Services in Angular with $provide

Wednesday, January 28th, 2015

In Angular, we can mock out services using $provide. Let’s look at a simple example.

Read More

Unit Testing Singletons

Monday, January 19th, 2015

Often times in web applications you only want a single instance of a class/constructor/reference type to ever be created. This is called the singleton pattern. Wikipedia defines the singleton pattern as:

Read More