Recent Web Log Entries By Ben Nadel
Grouping Nested ngRepeat Lists In AngularJS
Posted: February 28, 2013 at 9:20 AM by Ben Nadel
The other day, I wanted to output a list of values in AngularJS using ngRepeat; however, I wanted that list to be grouped into sublists. Out of the box, ngRepeat doesn't have any group-by control, like ColdFusion does . But, nesting ngRepeats is fairly straightforward if you take on the responsibility of creating the groups yourself. ... read more »
Comments (4) | Post Comment | Ask Ben | Permalink
POIUtility.cfc Now Hosted On GitHub
Posted: February 26, 2013 at 9:33 AM by Ben Nadel
This is just a quick post to say that my old POIUtility.cfc is now hosted on GitHub . I cleaned the codebase up a little, adding some organizational folders; but, mostly, it was copied over as-is to GitHub. For those of you who have no idea what the POIUtility.cfc is, it's a ColdFusion component (and set of ColdFusion custom tags) that facilitat... read more »
Comments (9) | Post Comment | Ask Ben | Permalink
Exploring Sample Software Application Layers And Responsibilities
Posted: February 22, 2013 at 9:59 AM by Ben Nadel
A couple of months ago, I summarized how I've been thinking about software application layers and the responsibility of those various layers . Of course, putting it on paper and putting it into action are two very different things. And, since then, I've found myself getting lost and confused as to which parts of the application belong in which la... read more »
Comments (12) | Post Comment | Ask Ben | Permalink
Using AtomicInteger To Create Uniquely Named CFThreads In ColdFusion
Posted: February 20, 2013 at 9:39 AM by Ben Nadel
When you use CFThread to run code asynchronously in ColdFusion, all threads in a given request need to be uniquely named. This is (theoretically) because all threads in a single request can be accessed, by name, using the "cfthread" scope, regardless of where in the codebase they were spawned. Failure to provide a unique name will precipitate the ... read more »
Comments (11) | Post Comment | Ask Ben | Permalink
Mixing Static And Dynamic Data In An AngularJS Select Menu
Posted: February 19, 2013 at 9:54 AM by Ben Nadel
Due to the data-driven, two-way binding nature of AngularJS input elements, mixing static and dynamic data in a single Select menu can be challenging. If your data it completely dynamic, it's a total breeze. But, the moment you want to add a static option, suddenly you have an asymmetric list of references that need to be mapped on to your View Mo... read more »
Comments (0) | Post Comment | Ask Ben | Permalink
Adding An ngRepeat List Delimiter In AngularJS
Posted: February 17, 2013 at 1:23 PM by Ben Nadel
Recently, I played around with an AngularJS directive that compiled and transcluded its target element . That experiment left me a little confused as to how the compile step actually worked; so, I wanted to take a step back and look at compiling an element with fewer facets. This time, rather than transcluding, I'm simply going to compile the DOM... read more »
Comments (11) | Post Comment | Ask Ben | Permalink
Using ngController With ngRepeat In AngularJS
Posted: February 15, 2013 at 4:20 PM by Ben Nadel
Most of the time, when you use the ngController directive in AngularJS, you're associating a Controller with a relatively static part of your user interface (UI). When it comes to ngRepeat, however, you can still use ngController - you just have to realize that you're creating a controller instance for every clone that gets created in the ngRepeat... read more »
Comments (19) | Post Comment | Ask Ben | Permalink
Directive Link, $observe, And $watch Functions Execute Inside An AngularJS Context
Posted: February 13, 2013 at 9:56 AM by Ben Nadel
When you run code inside an AngularJS Controller or Service object, you never have to worry about calling $apply() since your code is executing inside of an AngularJS "context." By this, I mean that AngularJS is aware that your code is running and will perform a dirty-check after the code has completed. When you're inside a Directive, however, Ang... read more »
Comments (2) | Post Comment | Ask Ben | Permalink
Using jQuery Event Delegation In AngularJS
Posted: February 12, 2013 at 9:52 AM by Ben Nadel
AngularJS is a very different beast when compared to jQuery (or vanilla JavaScript). In AngularJS, "context" is truly a first-class citizen. By that, I mean that AngularJS executes every piece of code in a specific container that is limited in scope. Unlike binding normal onclick event handlers, which have the entire document as a context, an ngCl... read more »
Comments (6) | Post Comment | Ask Ben | Permalink
Exploring Directive Controllers, Compiling, Linking, And Priority In AngularJS
Posted: February 9, 2013 at 6:41 PM by Ben Nadel
Recently, I talked about using Controllers inside of AngularJS Directives as a way to facilitate inter-directive communication . For simple directives, this seems to work great; however, I recently ran into a wall when trying to use directive controllers in conjunction with a directive that also had a compile() function. In my case, a non-compile... read more »
Comments (2) | Post Comment | Ask Ben | Permalink
Using Controllers In Directives In AngularJS
Posted: February 1, 2013 at 5:46 PM by Ben Nadel
In AngularJS, you have your Views, which present data to the user; you have your Controllers, which manage the $scope (ie. view model) and expose behavior to the View; and, you have your Directives, which link user interactions to $scope behaviors. But then you also have a special kind of Controller - a Directive Controller. The Directive Controll... read more »



