Note: Post updated for best practices in 2017! When you want to use ES6 you’re faced with a list of questions: Transpilers, shims, browser support… In this article, I’ll give you a detailed guide on making sure you get started with ES6 the right way, and instructions on how you can set up a workflow for using ES6 in production …
AngularJS best practices: Be careful when using ng-repeat’s $index
“A customer reported they deleted an item and the wrong item got deleted!” Sounds like a pretty serious bug. This is what we got one time at work. Attempting to locate it was quite difficult, because naturally the customer had no idea what they did to reproduce the issue. Turns out the bug was caused by using $index in an …
How to reduce bugs in JavaScript code by following the rule of consistent types
One of the most annoying type of bug in JavaScript code is when the code doesn’t have logical types. Oh hey, I’ll just sum these two numbers… NOPE! They’re actually strings! That just makes me so angry. To make matters worse, this is something I’ve had to deal with a lot with a codebase I’ve been working with recently. JavaScript …
Book review: Dependency Injection with AngularJS
Are you in the market for a book on AngularJS? Here’s my review of the book Dependency Injection with AngularJS, written by Alex Knol and published by Packt Publishing. Disclaimer: I was sent a free copy of the book for review purposes.
Tips for taking screenshots with PhantomJS + CasperJS
It’s quite easy to use PhantomJS to muck around with pages, especially if you use CasperJS which provides you a bit nicer API. It’s also pretty easy to take screenshots, but there’s a few things you need to take into account if you want the results to be accurate…
AngularJS best practices: Refactoring existing code to Angular
I’ve been involved in several projects where I worked on moving an existing codebase into using AngularJS. Some involved refactoring a small codebase, which is relatively straightforward in most cases, but I’ve also refactored much larger projects where moving everything at once is not an option. Here’s some best practice type stuff that I’ve learned along the way.
Using AngularJS for fast prototyping
One of the big pain points in web application development used to be quickly prototyping site layouts. Now we have things like Bootstrap and other CSS frameworks, which give you a quick grid and a bunch of other reusable components. But that does not solve the whole issue: In today’s web applications, standard page load style actions just don’t cut …
3 ways to get backend data to AngularJS
It seems this is a rather common conundrum with Angular code: You have some backend data, say in PHP or Rails, and you want to output it when rendering the page so that Angular can display it. Since Angular is designed to work more as a single-page app framework, it isn’t immediately obvious how to do this without Ajax, so …
Knockout vs Backbone vs Angular
There’s a lot of talk of various client-side kind-of-mvc libraries. Three of the popular ones I’ve used are Knockout, Backbone and Angular. While there are other comparisons of the three, I feel many of them don’t really touch on some of the aspects that I’ve come to learn from my experiences with the three.
I made a thing: Planetside 2 minigame
Random ideas and idle hands lead from one thing to another. While waiting for the Planetside 2 (a large scale MMOFPS) beta to land, I decided to make a hex-grid of the game’s map. Once the map is complete, someone suggests it should be colored in one of the three in-game faction’s colors… then I realize, why not just let …