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 cf.Objective() 2010 (Minneapolis, MN) with: Jared Rypka-Hauer

Recent Blog Posts by Ben Nadel

Asking The User To Confirm Location Or Route Changes In AngularJS

By Ben Nadel on March 25, 2015

The other day, Ward Bell and I were discussing both the future and existing routing features in AngularJS . In that conversation, we talked about what was and wasn't an appropriate responsibility for a routing module. In my opinion, the router itself shouldn't know when it's safe to navigate awa... read more »

Using $rootScope.$emit() As A Performance Optimization In AngularJS

By Ben Nadel on March 24, 2015

Yesterday, I looked at how to create a simple modal window system in AngularJS . In that exploration, I used the $rootScope to bridge the gap between the modal Service and the modal directive. In the past, I've used the same approach to bridge the gap between a global uploader service and its Plu... read more »

Creating A Simple Modal System In AngularJS

By Ben Nadel on March 23, 2015

For most of my web development career, "modal windows" have been something of a blackbox. Meaning, I've never really implemented one myself - only consumed various UI (User Interface) libraries, such as jQuery UI or Bootstrap, that provided a modal window solution. The problem with this is that it ... read more »

$location Search-Parameter Data Type Depends On Source In AngularJS

By Ben Nadel on March 20, 2015

In AngularJS, the $location service provides a two-way relationship between the browser's URL and the model in your application. This means that the URL can change the model and, conversely, the model can change the URL. This creates an interesting situation in which query-string parameters (aka, s... read more »

ngRoute Exposes The Original Route Definition Through Prototypal Inheritance In AngularJS

By Ben Nadel on March 19, 2015

With the ngRoute module in AngularJS, you can put anything you want in the original route definition object . These custom properties will then be exposed on the current route as the user navigates around your application. One thing to note, however, is that the original route definition object is... read more »

ng-Template Requests Are Affected By $http Interceptors In AngularJS

By Ben Nadel on March 18, 2015

The other day, when I was exploring routing, nested views, and caching with ngRoute in AngularJS 1.x , I noticed something very interesting: the network latency, that I was simulating with an $http interceptor , was also delaying the loading and rendering of ng-template content. After a little di... read more »

Simulating Network Latency In AngularJS With $http Interceptors And $timeout

By Ben Nadel on March 17, 2015

Over the weekend, when I was exploring routing, caching, and nested views with ngRoute in AngularJS 1.x , I wanted to slow down the HTTP speed so that the user could experience Views in a "pending state." But, because I was working with my local system, HTTP requests were completing very quickly, ... read more »

Revisiting Routing, Nested Views, And Caching With ngRoute In AngularJS 1.x

By Ben Nadel on March 16, 2015

It's been a few years since I wrote the AngularJS routing system for InVision App . And, once it was done, I didn't really think about it again. But, the recent Adventures in AngularJS podcast, on the Angular-UI router , has me thinking about routing once more. I know that the new AngularJS 2.0... read more »

Forcing $q .notify() To Execute With A No-Op In AngularJS

By Ben Nadel on March 13, 2015

I work with a lot of client-side, cached data. And, before AngularJS added the .notify() event to the $q service in AngularJS 1.2, I had to jump through a lot of really hacky and unfortunate hoops to get deferred values to resolve twice (once with cached data, once with live data). The .notify() ... read more »

Using GREATEST(), LEAST(), And Date/Time Values With COALESCE() In MySQL

By Ben Nadel on March 11, 2015
Tags: ColdFusion, SQL

The other day, I needed to find the largest and smallest date/time values across a collection of tables in MySQL. This gave me an opportunity to use MySQL's GREATEST() and LEAST() functions for the first time; however, I found out that these two functions return NULL if any argument is NULL. To cop... read more »

Using Method Chaining With The Revealing Module Pattern In JavaScript

By Ben Nadel on March 10, 2015

Yesterday, I looked at creating null-prototype objects in Node.js . As part of that exploration, I created a very simple cache class with public methods that could be chained. However, since the public methods were exposed using the revealing module pattern, it dawned on me that the "this" referen... read more »

Creating Objects With A Null Prototype In Node.js

By Ben Nadel on March 9, 2015

A while back, when I was reading the Principles Of Object-Oriented JavaScript by Nicholas Zakas , I came across a tip about using Object.create() to create objects with a null prototype. Such an object wouldn't inherit from Object.prototype and would, therefore, have no keys in it. Zakas suggested... read more »

It Walks Like A Duck, It Quacks Like A Duck, But It's A Donkey - The Problem Of Inappropriately DRY Code

By Ben Nadel on March 6, 2015

I spend a lot of time refactoring old code. And, as I do this, I keep seeing the same problem over and over again. As developers try to keep their code DRY, as in "Do-not Repeat Yourself," they often ignore a critical point of evaluation - the code's reason for change. When this property is ignored... read more »

Thinking About Inversion Of Control (IoC) In Node.js

By Ben Nadel on March 5, 2015

This year, I really want to get serious about building scalable systems with Node.js . And, anytime you move from one context to another, I think it's natural to consider forklifting practices from one context to the next. So, as I expand from AngularJS to Node.js (in terms of JavaScript), I wonde... read more »

When Do You Need To Compile A Directive In AngularJS

By Ben Nadel on March 4, 2015

On the most recent episode of Adventures in Angular, on Advanced Directives , Ward Bell and Joe Eames posed a very provocative question - When do you actually need to use the compile phase of an AngularJS directive? It used to be that you needed the compile in order to access the transclude fu... read more »

MySQL EXISTS() Operator Returns True Or False

By Ben Nadel on March 3, 2015
Tags: ColdFusion, SQL

For years, I've been using the SQL EXISTS() operator to help limit the number of results in a data set . But, it wasn't until just yesterday that I actually started to think about what EXISTS() returned - I sort of just took it for granted that it worked in a WHERE clause. As it turns out, EXISTS(... read more »

Shedding The Monolithic Application With AWS Simple Queue Service (SQS) And Node.js

By Ben Nadel on March 2, 2015

For too long, I have lived in the world of the monolithic web application - the single application that does everything for everyone. This year, I really want to evolve my understanding of web application architecture and try to think about applications as a collection of loosely coupled services. ... read more »

Using The Amazon Web Services (AWS) SDK To Create Pre-Signed S3 URLs With Path-Style Access

By Ben Nadel on February 27, 2015
Tags: ColdFusion

Amazon's Simple Storage Service (S3) provides two different ways to structure your S3 URLs. In the "virtual-hosted-style", your bucket name becomes part of the domain; and, in the "path-style", your bucket name becomes part of the resource (as a prefix to your object key). When you're making reques... read more »

Using Plupload To Upload Files Directly To Amazon S3 Using PUT And Pre-Signed (Query String Authenticated) URLs

By Ben Nadel on February 26, 2015

Out of the box, Plupload hard-codes the "POST" method when it uploads a file to the remote server. This is fine if you want to upload files to Amazon S3 using a form upload policy ; but, it falls short if you want to upload files to Amazon S3 using a pre-signed URL . Pre-signed (aka, query string... read more »

Be Careful With Compound Conditions In AngularJS (And JavaScript In General)

By Ben Nadel on February 25, 2015

This post really has nothing to do with AngularJS specifically; but, I happen to trip over this feature of the JavaScript language while constructing an AngularJS view. As such, I thought I should present it in an AngularJS context in case other Angularistas find it interesting. What I'm referring ... read more »

Creating A Factory Provider For The Configuration Phase In AngularJS

By Ben Nadel on February 24, 2015

Yesterday, in my post on consuming Data URIs in an AngularJS application , I created a caching service that would automatically evict cache entires after a static period of time. As I was building that, it occurred to me that the eviction-timeout is probably something that should be exposed during... read more »

Consuming Plupload Data URIs In An AngularJS Application

By Ben Nadel on February 23, 2015

I've been using Plupload as my HTML5 uploader in AngularJS for a long time. I've even looked at the mechanics of extracting a Base64-encoded image preview from a Plupload file ; but, I've never really noodled on how to best consume those data URIs in the context of a real AngularJS application. ... read more »

  Is Not A Four-Letter Word

By Ben Nadel on February 19, 2015
Tags: HTML / CSS

Before we had CSS (Cascading Stylesheets), we had Font tags. And Table layouts. And, of course, the beautiful and ever-versatile "spacer.gif". When CSS came along, however, we were able to get rid of these hacky and verbose solutions. And, the more that modern browsers support advanced CSS, the mor... read more »

Volatile Keys Can Expire Mid-MULTI-Transaction In Redis / Jedis

By Ben Nadel on February 19, 2015
Tags: ColdFusion, Redis

Yesterday, I was surprised to find that I had 4 keys in my Redis name-space that had no expiration date (Time-To-Live). I'm creating hundreds-of-thousands (if not millions) of keys a day, all with expiration dates. And yet, 4 of them were persisted without an expiration date. Such a tiny number of ... read more »

Animating A Single Item Using ngRepeat And ngAnimate In AngularJS

By Ben Nadel on February 18, 2015

It's easy to think about animations when you have objects that have conditional existence. Meaning, sometimes they're on the page, sometimes they're not. But, what about when you have data that is always present, but is sometimes changing? How can you animate that? One idea would be to create a cus... read more »

Deferring Route Configuration Using Decorators And Route Resolution In AngularJS

By Ben Nadel on February 16, 2015

After recently learning about service decorators and route resolution in AngularJS , I wanted to see if I could have a little fun with the two features combined. While I don't really have a use-case for this experiment, I wanted to see if I could create a $route service decorator that would allo... read more »

Route Resolution Using Factory Functions vs. Services In AngularJS

By Ben Nadel on February 14, 2015

The other day, I started digging into route resolution in AngularJS . In that post, I demonstrated that you could delay the $routeChangeSuccess event by creating one or more promises during the route transition. In that post, I was using a resolution factory function; but, I could have also used a... read more »

Exploring $route Resolution In AngularJS

By Ben Nadel on February 12, 2015

After my recent posts on AngularJS routing and the back-button and how route params are passed-around in redirectTo actions , I wanted to take a look at route resolution. This is a feature that I've never actually used before; but, in AngularJS, you can defer the triggering of the $routeChangeSu... read more »

$route redirectTo Will Pass-Through Current Route Params In AngularJS

By Ben Nadel on February 10, 2015

After my demonstration yesterday, that the redirectTo operation in AngularJS routing wouldn't break the back button , I wanted to dig into redirectTo a bit more. It's easy to redirect to a static string; but, what about redirecting to a dynamic path? As it turns out, AngularJS supports this implic... read more »

$route redirectTo Does Not Break The Back Button In AngularJS

By Ben Nadel on February 9, 2015

When defining routes in an AngularJS application, you can provide routes that do nothing but redirect to other routes. This works for both explicitly defined routes as well as for the catch-all "otherwise" route. One awesome feature of the "redirectTo" property, which I just discovered, is that it ... read more »