Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
Part 1: Shifting From Android To Web Development

Learning to make front end web applications requires learning a few things in parallel—the language, the framework of choice, the test framework, the build system, and the different ways you can style things. This post will help you map your knowledge of Android to the equivalent in web in 5 easy steps.

LABS
Unit-Testing AngularJS in a Rails app using the Jasmine gem

Testing AngularJS applications is easy with Jasmine. If you look at the AngularJS docs, many of the code examples show a corresponding Jasmine spec.

One important part of AngularJS’s testing support is the included angular-mocks.js file. This file contains a module called NgMock that provides a set of fake services for things such as HTTP requests, in order to make them easier to unit test.

Read more »

LABS
Getting Started with Angular: Dealing with Scopes/Controllers

A common source of confusion among new Angular developers is scopes. The parent-child scope model is confusing, and it isn’t straightforward how to share data between scopes. It’s common in applications to see nested controllers and heavy use of scope inheritance.

Read more »

LABS
Rails is omakase; so is AngularJS

Opinions

DHH, one of the creators of Rails wrote a seminal blog post about Rails’ configurability and design to permit choice, while still presenting opinions on application structure. This sits well with my general sense of what’s right. I like things that don’t force me to make arbitrary decisions early on in development.

Read more »

LABS
How to use Analytics.js to fix your analytics code and achieve metrics nirvana

There are so many great analytics tools out there that it’s often hard to know what to use. What’s more, each one comes with its own flavor of JavaScript API that’s slightly different from all the rest, meaning each new one you choose to add, even if you’re not sure it’s right for you, is a ton of work to implement.

Read more »

LABS
Decoupling JS from the DOM

There has been a big shift in the last few years toward javascript frameworks that dictate how we deal with the DOM. In this series I want to highlight the value in “progressive enhancement” style patterns when it comes to interacting with the DOM.

Read more »

LABS
Swapping between JavaScript spec and implementation in RubyMine

When test driving your code, you inevitably end up switching between the tests and the implementation.  In Rubymine, there is a handy command-shift-T shortcut for doing this with ruby files, but it does not work for javascript files.  It isn’t too hard to add javascript functionality.  

Read more »

LABS
Writing Beautiful Specs with Jasmine Custom Matchers

Custom matchers are one of Jasmine’s most powerful, and yet underutilized, features.

Here at Pivotal Labs, we write tests for a few reasons: to drive feature development, to catch regressions, and to provide code documentation to other developers.  Because of this, it is important that our tests are not only comprehensive, but also descriptive and legible.

Read more »

LABS
Copying text to the clipboard in Ember.js with ZeroClipboard

If you’re used to working with Backbone.js, you may be accustomed to writing your own render method for your views. Typically, it looks something like:

var MyView = Backbone.View.extend({ render: function () { this.$el.html(this.template(this.model.toJSON())); } });

In contrast, in Ember.js, rendering is done for you.

Read more »

LABS
Accessible UI Widgets using ARIA

ARIA attributes are a robust alternative to arbitrary class names when applying styles and behaviors to your markup. When you use ARIA attributes to target elements, you introduce accessibility support while standardizing your markup.

Non-standard class names

As a web developer, you may often find yourself toggling a class name with javascript to apply CSS, like so:

[gist id=6452923]

[gist id=6452738]

The Problem

This approach adds a non-standard class name, .hidden, that we rely on for our behavior.

Read more »