Automated End To End Testing for Angular

I first learned protractor for use in end to end (E2E) testing for bigshotbracket.com. That was a savage crash course, with a lot of mistakes. My latest project has given me a chance to review how I implemented that testing, and improve on it. I finally feel like I understand it well enough to share with confidence that I'm doing things correctly. So I'll expand on the concepts from the official tutorial and it's limited handling of page abstractions.

Tags: 

AngularJS - Hold To Activate Button Directive

I needed a hold button that gave visual feedback. This fills with a color and duration you define then calls whatever method you give it. Arguments are allowed as part of the success callback. I'll continue to tweak on it as I use it more.

Tags: 

Writing CSV Files Using Drupal

I'm leaving this one here, mostly as a note for myself. I've found too often that samples on the web, and indeed in existing code I inherit are chalked full of 'doing it the hard way' and memory leaks. This is the simplest and cleanest method for handling streaming large amounts of data out to a csv.

Tags: 

Lazy Loading Angular (<= 1.3) Controllers

As your angular application grows, you'll quickly look for ways to distribute logic into manageable portions. You could (and should) simply produce js files dedicated to directives, controllers, and app separately, then use grunt to create your production file. But, you can do one better than that. You can simply not load entire sections of the site the user never visits. Through the use of require.js and angular's ui-router you can lazy load page controllers on demand, just like the template files.

File Breakdown

To make this work you'll need the following setup:

Tags: 

Pages

Subscribe to Fragmented Thought RSS