O'Reilly logo

AngularJS Directives by Alex Vanston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Diving in

With that, let's go ahead and dive into writing some code to build this... Wait, you know better than that. We just spent two chapters on the value of testing and the importance of writing those tests before our code; surely you haven't forgotten all that already. So instead, let's write up some unit tests to serve as our initial specification. If you're following along on your own machine, you'll need to setup Karma as before, or just copy our last setup over and rename the files. Once you have that ready and Karma running, let's create a unit test file with two initial tests:

 describe('Content Grid', function () { var $compile , $rootScope , tpl = '<div content-grid="elements"></div>' , elements = []; beforeEach(module('mvdContentGrid')) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required