Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at CFUNITED 2009 (Lansdowne, VA) with:

Recent Blog Posts by Ben Nadel

Aborting AJAX Requests Using $http And AngularJS

By Ben Nadel on April 24, 2014

If you're coming from a jQuery background, you're probably used to calling .abort() on the AJAX (Asynchronous JavaScript and XML) response object (jqXHR) . In AngularJS, things are a little bit more complicated. AngularJS don't expose the .abort() method; but, it does provide a way to abort an act... read more »


Posting Form Data With $http In AngularJS

By Ben Nadel on April 23, 2014

By default, when you go to post data in an AngularJS application, the data is serialized using JSON (JavaScript Object Notation) and posted to the server with the content-type, "application/json". But, if you want to post the data as a regular "form post," you can; all you have to do is override th... read more »


httpi - A Lightweight $resource-Inspired Module For AngularJS

By Ben Nadel on April 22, 2014

As I blogged about before, I'm not a huge fan of the $resource module in AngularJS . But, it does have some features that I do like; namely, URL interpolation and the encapsulation of URLs across requests to the same resource. I created the "httpi" module in an attempt to build these features on t... read more »


Using URL Interpolation With $http In AngularJS

By Ben Nadel on April 22, 2014

For the past two years, I've been using the $resource service in AngularJS to make my AJAX (Asynchronous JavaScript and XML) calls. But, I've always felt that the $resource service added a lot of cruft and complexity that I didn't need (or use). So, I've started digging into the underlying $http s... read more »


Using The $http Service In AngularJS To Make AJAX Requests

By Ben Nadel on April 21, 2014

When I first got into AngularJS, I started using the $resource service to communicate with the backend. This wasn't a decision that I made based on thoughtful analysis; rather, I was simply doing what I saw in various AngularJS tutorials. In retrospect, it was an unfortunate decision. There's nothi... read more »


Using ORDER BY And LIMIT Clauses In A UNION SQL Statement

By Ben Nadel on April 18, 2014
Tags: ColdFusion, SQL

When it comes to SQL (Structured Query Language), I don't use the UNION construct all that often. But, when I do, one of the features that makes it so powerful is the fact that you can apply both an ORDER BY clause and a LIMIT clause to the derived result set of the union (at least in MySQL). Furth... read more »


Using JSONP With $resource In AngularJS

By Ben Nadel on April 17, 2014

The other day, I was tracking down an "Access Denied" error when I came across an AngularJS $resource that was making a Cross-Domain request. It seemed that this was only happening in IE9 (if memory serves me correctly), so I assumed that it was a limitation with CORS (Cross-Origin Resource Sharing... read more »


Internet Explorer Aborts Images With The Wrong Mime-Type

By Ben Nadel on April 15, 2014
Tags: ColdFusion

This is a really quick post; but, it took me over an hour to debug the other day, so I thought I would share. I was in a situation where I had to serve up images. This seemed to work well in every browser except IE (Internet Explorer). Furthermore, IE seemed to serve up some images and not others. ... read more »


Finding Shallow HTML Comment Nodes In The DOM Using TreeWalker

By Ben Nadel on April 14, 2014

The other day, I starting playing around with the TreeWalker API as a way to iterate over HTML comment nodes contained within a given DOM (Document Object Model) node. When I first started tinkering, it didn't look like there was any way to perform a "shallow" search (ie, only look at child nodes... read more »


Finding HTML Comment Nodes In The DOM Using TreeWalker

By Ben Nadel on April 12, 2014

The other day, I blogged about my jQuery plugin that facilitates searching the DOM (Document Object Model) for Comment nodes based on pseudo attributes . While I was writing that plugin, I came across a relatively new JavaScript API, the TreeWalker. The TreeWalker provides an iteration interface f... read more »


Searching The DOM For Comment Nodes Based On Value And Pseudo-Attributes

By Ben Nadel on April 11, 2014

A couple of years ago, I wrote a really simple jQuery plugin that searched a given DOM (Document Object Model) node for nested Comment nodes. But, it was an all or nothing approach; meaning, you either got comments or you didn't. It wasn't terribly useful. So, I wanted to see if I could rewrite t... read more »


$scope.$evalAsync() vs. $timeout() In AngularJS

By Ben Nadel on April 9, 2014

Sometimes, in an AngularJS application, you have to explicitly tell AngularJS when to initiate it's $digest() lifecycle (for dirty-data checking). This requirement is typically contained within a Directive; but, it may also be in an asynchronous Service . Most of the time, this can be easily accom... read more »


The User Experience (UX) Of Sketching In Prototyping

By Ben Nadel on April 8, 2014

The first step in my design process is always rough sketching. This is where I try to translate my mental model into some sort of visual experience. While it's far from perfect, sketching can really help me think through the design of a user experience (UX). For me, sketching happens in two places:... read more »


Directive Controller And Link Timing In AngularJS

By Ben Nadel on April 5, 2014

I've talked about the timing of directives in AngularJS a few times before. But, it's a rather complicated topic, so I don't mind digging a bit deeper. This time, I'm looking at the timing of directive controllers vs. directive link functions. As the DOM (Document Object Model) is compiled by Ang... read more »


The User Experience (UX) And Cognitive Dissonance Of Forms

By Ben Nadel on April 3, 2014

Forms are perhaps the most infamous aspect of web development. No one enjoys developing them and, apparently, no one enjoys using them. But here's my cognitive dissonance - almost no Form has ever stood between me and something that I wanted. Maybe I can vaguely remember a form or two that was so c... read more »


The User Experience (UX) Of Color Contrast In A Call-To-Action

By Ben Nadel on April 1, 2014

I don't use the Google Mail app on my iPad all that much. I'll glance at the inbox to see if there are any emergencies; but, beyond that, I don't do anything that requires significant interaction. As far as I'm concerned, my iPad is for consumption, not production. From time to time, I'll send myse... read more »


Implementing Java's Collections.Shuffle() In JavaScript

By Ben Nadel on April 1, 2014

When I'm working with ColdFusion, and I need to shuffle an array of items, my default move is to pass the array down into the Java layer where I can leverage the Collections class . There, the shuffle() method makes sorting an array a simple task. The other day, I needed to shuffle a JavaScript ar... read more »


The Principles Of Object-Oriented JavaScript By Nicholas Zakas

By Ben Nadel on March 30, 2014

Over the weekend, I finished reading The Principles of Object-Oriented JavaScript by the famed Nicholas Zakas . In a relatively short 116 pages (less the index) Zakas takes the reader through the ins-and-outs of using objects in JavaScript. But, don't be confused - this is not a philosophical book... read more »


Years Later, I Still Love jQuery

By Ben Nadel on March 28, 2014

As modern browsers have become more modern and JavaScript frameworks have become more robust, there seems to be a growing trend amongst front-end developers in which the desire to use jQuery has diminished. In the most extreme cases, I even hear people talk about jQuery as something they can "final... read more »


Preloading Images In AngularJS With Promises

By Ben Nadel on March 27, 2014

When I first started using AngularJS, I was so concerned with doing things the, " Angular Way ," that I ended up making some poor choices. Most noticeably was the way in which I tried to preload images in my application. Thinking only of images as "DOM" (Document Object Model) elements, I delegated... read more »


Case Study: Using $scope.$digest() As A Performance Optimization In AngularJS

By Ben Nadel on March 25, 2014

Yesterday, I blogged about using the $scope.$digest() method in AngularJS as an optimization over the more traditional $scope.$apply() method . Since this is a special kind of optimization that cannot be applied in a general manor, I wanted to present a case-study in which the $digest optimization... read more »


Using $scope.$digest() As A Performance Optimization In AngularJS

By Ben Nadel on March 22, 2014

The other day, I was listening to Brian Genisio , on the Front-End Developer Cast , when I heard him draw a distinction between the $apply() method and the $digest() method in AngularJS. The $apply() method will trigger watchers on the entire $scope chain whereas the $digest() method will only tr... read more »


Using Transparent Select Menus To Create Styled Menu Roots

By Ben Nadel on March 21, 2014

At work, we use Trello for our project management. It's a super light-weight tool that offers an unopinionated approach to task management. But, more than that, it presents some really cool technical choices. One such choice that I wanted to look at was their use of transparent Select menus. I a... read more »


IsValid() Accepts Emails With Leading And Trailing Whitespace In ColdFusion

By Ben Nadel on March 18, 2014
Tags: ColdFusion

This is just a quick note about validating email addresses with the isValid() function in ColdFusion. While debugging a issue in one of my applications, I discovered that isValid() accepts email addresses as being valid even if they contain leading and / or trailing whitespace. Take a look a this d... read more »


Hooking Into The Complete Event Of An ngRepeat Loop In AngularJS

By Ben Nadel on March 14, 2014

Earlier today, I was talking to Brian Feister on Twitter about invoking a callback when an ngRepeat loop had finished rendering for the first time. This isn't something that the ngRepeat directives exposes naturally; but, I had an idea of how you might be able to accomplish this with a sibling di... read more »


Embedding Foreign Characters In Your Content-Disposition Filename Header

By Ben Nadel on March 13, 2014
Tags: ColdFusion

Since English is my primary language, I sometimes don't realize that aspects of my web applications don't play nicely with non-US ASCII characters. Such is the case with the "Content-Disposition" header. I've been using it for years; but, only found out last week that the "filename" portion of the ... read more »


Sanity Check: $index vs. DOM In AngularJS Directives

By Ben Nadel on March 4, 2014

With AngularJS, there is such a strong separation between the DOM (Document Object Model) and your Controller / Model / Service components, that I sometimes find myself unsure as to when I can depend on the existence of dynamically-generated DOM nodes within AngularJS directives . The other day, I... read more »


Using The Timeout Attribute With CFHttp In ColdFusion To Limit Blocking

By Ben Nadel on February 26, 2014
Tags: ColdFusion

By default, when you make a CFHttp request in ColdFusion, the tag will block the current page request until the CFHttp tag returns a response. Most of the time, this is what you want. But, if you're dealing with a non-critical request (such as a 3rd-party "event" API), it can often make sense to pr... read more »


The Elvis Operator vs. IsNull() In ColdFusion 11 Beta

By Ben Nadel on February 25, 2014
Tags: ColdFusion

In the beginning, ColdFusion gave us isDefined(). Then, structKeyExists(). And, as the concept of "null" started to become a first-class concept, ColdFusion delivered unto us isNull(). Now, with ColdFusion 11 Beta, we have the "elvis" operator - ?: - so called because it looks like a well-coiffed e... read more »


Robust CFScript Suport For Tags In ColdFusion 11 Beta

By Ben Nadel on February 24, 2014
Tags: ColdFusion

Over the past several releases of ColdFusion, the support for CFScript have been getting much better. In fact, I write most of my ColdFusion code in CFScript; but, the CFScript feature set does leaves something to be desired. With ColdFusion 11 Beta, however, it looks like Adobe has finally given u... read more »