Creating a custom plugin

Example

See the Pen Videogular – Creating a Custom Plugin by Two Fucking Developers (@2fdevs) on CodePen.

Description

As you can see this is basically the same example that we saw before but packed in a directive.

This approach is cleaner, you grab the API through a require and the rest is pretty much the same.