angular Posts

Angular, Protractor tests, and Sauce Connect config

So it took me days of trying to piece together the correct config options to make my local protractor test suite run in a bunch of different setups on Sauce Labs.

// An example configuration file.
exports.config = {

    sauceUser: 'jgrubb',
    sauceKey: 'fill-in-the-blank',
    sauceSeleniumAddress: 'localhost:4445/wd/hub',

    // Capabilities to be passed to the webdriver instance.
    // This option is called "capabilities" in the protractor docs
    // but whatever.  this also works.
...

Getting started with "Headless Drupal"

Hello there! There has been a lot of discussion in the Drupalsphere lately about a concept that has been coined "Headless Drupal", and rightly so. It's basically theming, but throwing out the theme layer. The theme layer in Drupal is very powerful, but has always felt severely over-engineered to me, especially in contrast to pretty much any MVC framework I've played with. With those, you define view-layer variables in a controller class, and you write HTML with a little bit of code to...

Drupal Angular tidbits -- multisite

Exposition

One of these days I'll get around to writing the post that's been in my head for 6 months now about how to get up and running with Angular in a Drupal setting. Today is not that day, however.

What I'd like to talk about today is a little hack that I came up with to allow me/us to maintain a single codebase to serve several different mobile apps.

Multisite Drupal

You're likely already familiar with this concept, and it has its proponents and its detractors. The second (anti)...

Cool Nginx feature of the week

Nginx configs

So I recently had a couple of seemingly disparate tasks come across my desk. We recently launched a HMTL mobile app, an Angular front end to our Drupal sites. We decided to completely decouple the mobile app from the Drupal codebase after a fairly long exploratory period trying out different approaches.

When launch day finally came, we set up the mobile app at app.$BRAND.com, with our main sites at www.$BRAND.com. Acquia has this cool feature in their Varnish layer that...

Function 'fooController' is undefined

I spent about an hour pulling my hair over this one. I'm deploying an Angular to dev for the first time, it works fine locally, but everything is busted when I grunt build and push it up to a server. I'm using ngMin and using the supposedly safe syntax for defining all my dependencies, but unfortunately any Google search that includes "grunt build" and/or "minify angular" only turns up answer that pertain to that fairly well know problem.

So, I commented out Uglify in the build process...

Building a mobile app with Drupal and Angular (part 1)

The beginning

I'll make the "what is Angular" part as brief as possible.

Angular is a giant JavaScript framework from our friends at Google. It fits into a similar camp with Backbone, a framework that Drupalists will likely have heard of since it's included in D8 core. Angular aims to make it as easy as possible to build a single page CRUD app, and in my limited experience it succeeds.

I've never built anything with Backbone, but have the Peepcode series on it, and have been working...