Implementing and using a third-party JavaScript library

In the past, Drupal has only shipped with jQuery and a few jQuery plugins used by Drupal core for the JavaScript API. This has changed with Drupal 8. Underscore.js and Backbone.js are now included in Drupal, bringing two popular JavaScript frameworks to its developers.

However, there are many JavaScript frameworks that can be used. In Chapter 5, Frontend for the Win, you learned about the asset management system and libraries. In this recipe, we will create a module that provides Angular.js as a library and a custom Angular application; the demo is available on the AngularJS home page.

Getting ready

In this example, we will use Bower to manage our third-party angular.js library components. ...

Get Drupal 8: Enterprise Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.