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

Connecting Masonry

At this point, we have a functioning directive that takes an array of content elements and displays them. That's great, but it's still missing the key piece: our Masonry integration. If you haven't already, go ahead and download the packaged JavaScript file from http://masonry.desandro.com. While Masonry can also be installed using Bower, it has several dependencies and requires a fuller build process, which is outside the scope of this book, so for now we'll just use the already packaged file.

Any time you want to connect a DOM manipulation plugin, there are a few things to keep in mind:

  1. Identify both the initialization and update methods for your plugin. Sometimes these are the same.
  2. Evaluate if the plugin needs to be told explicitly ...

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