Bootstrapping the applications

When we linked require.js to our application, we told it to use main.js as our entry point. To test that this works, let's start by entering a dummy main.js. JavaScript files in Play applications go in /public/javascripts:

// public/javascripts/main.js

require([], function() {
  console.log("hello, JavaScript"); 
});

To verify that this worked, head to 127.0.0.1:9000 and open the browser console. You should see "hello, JavaScript" in the console.

Let's now write a more useful main.js. We will start by configuring RequireJS, giving it the location of modules we will use in our application. Unfortunately, NVD3, the graph library that we use, does not play very well with RequireJS so we have to use an ugly hack to make it ...

Get Scala for Data Science 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.