The application I’m developing at work has many independent parts, which needed their own states. Think of a UI similar to Photoshop, WebStorm, or such – Every panel in the UI is self-contained and can be changed without affecting the others. The standard ui-router has no concept of parallel states. Everything must be modeled as a tree, which means a …
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 …
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.
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.