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() 2009 (Minneapolis, MN) with: Scott Stroz

Recent Blog Posts by Ben Nadel

The Affect Of Back-Pressure When Piping Data Into Multiple Writable Streams In Node.js

By Ben Nadel on April 18, 2015

As a learning exercise, I wanted to try and create a small static file server in Node.js. I figured this was small enough but, complex enough to help me learn about the Node.js fundamentals. During one of my refactoring efforts, I noticed that some larger files were only being "partially served" to... read more »

Managing User Input Key-Events Across Views In AngularJS

By Ben Nadel on April 14, 2015

Managing click events, in an AngularJS application, is somewhat straight-forward because the structure of the DOM (Document Object Model) very closely mirrors the order in which click handlers will be invoked. Key-events, on the other hand, are not so simple. Not only are the events not necessarily... read more »

Directive Controllers Cannot Use The Revealing Module Pattern In AngularJS

By Ben Nadel on April 12, 2015

This is just a quick blog post (more of a note-to-self) to demonstrate the fact that you cannot use the revealing module pattern with Directive Controllers in AngularJS. And, just to be clear, all controllers, in AngularJS, are "directive controllers." Meaning, the ngController directive is nothing... read more »

$animate:before, $animate:after, $animate:close And The ngAnimate Enter Workflow In AngularJS

By Ben Nadel on April 11, 2015

After my blog post yesterday, on animating an element in from a mouse-click location in AngularJS , I was a little irked that I couldn't get consistent results from the "$animate:before" and "$animate:after" events triggered by the $animate service. I couldn't figure out how they fit into the over... read more »

Animating Elements In From A Mouse-Event Location Using ngAnimate And AngularJS

By Ben Nadel on April 10, 2015

The ngAnimate module, in AngularJS, is pretty awesome. This is especially true when your transitions can be defined entirely within your CSS files. In that case, your code doesn't need to know anything about your animations at all. But, if your transitions need to be partially defined by context-se... read more »

CAUTION: Overloading The ng-Controller Directive In AngularJS

By Ben Nadel on April 8, 2015

I'm putting " CAUTION " right in the title here because I'm not actually recommending that anyone do this. This is just a fun experiment whose only purpose is to demonstrate some of the flexibility and the power that the AngularJS directive architecture provides. We've already seen how powerful it ... read more »

Exposing An Optional Directive Template Using ng-Template And The $templateCachce() In AngularJS

By Ben Nadel on April 7, 2015

Most directives can be easily defined by a single template. But, some directives are not so clear-cut. This is especially true for 3rd-party directives. Case in point, the "tooltip." The tooltip is a rendered element; but, it doesn't replace its contextual content. It's kind of an odd mixture of bo... read more »

Directive Architecture, Template URLs, And Linking Order In AngularJS

By Ben Nadel on April 3, 2015

When it comes to directive compiling, linking, and general timing in AngularJS, it probably feels like I'm beating a dead horse. But, the reason that I keep revisiting the topic is because the directive workflow is a complex multi-faceted process that keeps revealing new quirks and edge-cases. Toda... read more »

Mutating Isolate Scope References In AngularJS

By Ben Nadel on April 1, 2015

When dealing with isolate-scope variable references, in AngularJS, reading data is a non-issue. And, technically speaking, mutating data is also possible. But, just because an isolate-scope component directive can mutate a given value, it doesn't mean that it should. The more I work with AngularJS,... read more »

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 »