12/24/2014

An Angular-ized Require-Based Script Loader

The co-author for this approach, who did a lot of the heavy lifting, is the very talented Nate Ferrero.

We recently found another speed bump as we carefully drove down our path to removing require.js in favor of Angular purity. We found hidden dependencies nestled into the code. Code development of any substantial kind that lives for any substantial amount of time with multiple developers quickly gains warts.

12/04/2014

The Synchronous in Angular Asynchronous Module Loading

Recently at the office, we have been removing Require.js from our base architecture and going as much Angular native as possible. This has been an extremely interesting exercise. One issue that become apparent immediately was code organization. Most code was loading as the callback function to a Require define block. With the define block gone, the scope suddenly went global and code that had been lumped together for Require callbacks no longer needed to cohabitate. The new challenge was how to organize code and keep global scope clean.

11/11/2014

Angular: Creating attributes in HTML Elements

Angular gives the HTML page a lot more power to build its own destiny. We can embed view only concerns directly into the HTML. This helps separate the business logic from the the display logic. Of course this has positive and negative implications. One positive I found this week was the ability to create HTML Element attributes dynamically with no JavaScript.

9/26/2014

Building an Angular List: Using ng-repeat

There are many things about Angular that make it an excellent framework to use, and one of my favorites is the way it's data binding simplifies the implementation of UI elements. One of the most useful elements, in my opinion, is the ng-repeat. Ng-repeat makes creating lists so simple that you will want to use them all the time.

9/03/2014

The jQuery Radio: Custom Triggers For a Pub/Sub Model

I like jQuery. It's the first library I used that gave me the "JavaScript is Awesome" tingle. Putting aside the many arguments for and against, jQuery is still used all around the web. When building from scratch we may choose more modern frameworks. However, building from scratch is a fine luxury and the exception to the norm. Many JavaScript programmers, if not most, spend their time improving existing sites and adding additional functionality. The result is that many of us still use jQuery on a daily basis. jQuery is also a great library for JavaScript beginners to get started with. So this post will visit one of jQuery's neatest features, "trigger".

6/04/2014

Angular and Jasmine: Injecting into the test environment

UPDATE: The team at Gaikai, where I work, has released an open source testing framework for Angular which streamlines this process and greatly simplifies the testing process. I wrote about it here: http://randomjavascript.blogspot.com/2015/01/ngtestharness-strap-in-with-this-new.html

I have set my sights on improving my Angular proficiency, however I am not ready to give up on all my other tools. I have a strong preference for Jasmine, and the recent release of 2.0 further cemented that comfort zone. Jasmine 2.0 made major improvements by removing window dependency and improving async support. Using Jasmine and Jasmine-Node together allows me to write tests in the same language for both server and client. I prefer to standardize as much as possible on a project, and having one language for tests on both application tiers is valuable to me in time and effort saved.

2/10/2014

Enyo Observables: Making kinds self-sufficient

These are exciting times in the Enyo world; Enyo is soon to release version 2.4. This is an extremely important release that brings MV* features and a host of language improvements. I am going to discuss a feature new to Enyo called "Observables", and the power it has when combined with Enyo's inheritance model.