Book Image

Play Framework Cookbook - Second Edition

By : Alexander Reelsen, Giancarlo Inductivo
Book Image

Play Framework Cookbook - Second Edition

By: Alexander Reelsen, Giancarlo Inductivo

Overview of this book

<p>As web and mobile systems become more sophisticated, anchoring systems in a mature, solid framework has become increasingly important. Play 2 provides developers with the necessary tools to build robust web applications.</p> <p>This book is a compilation of useful recipes aimed at helping developers discover the power of Play 2. The introductory section serves as a primer to Play Framework, wherein all the fundamentals of the framework are covered extensively. It then explains the usage of controllers and how modules can be leveraged for optimal performance. Next, the book walks you through creating and using APIs, followed by extensive real-world applications. Finally, you will learn to manage applications post production.</p>
Table of Contents (15 chapters)
Play Framework Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Integrating a Play application with AngularJS


For this recipe, we will integrate a Play web application with an AngularJS-based frontend. AngularJS is a popular JavaScript framework and provides developers with tools to build powerful interactive UIs with ease. Some familiarity with AngularJS is assumed for this recipe.

More information about AngularJS can be found here at https://angularjs.org/.

In this recipe, we will also use WebJars, a Play-friendly dependency management repository, to manage our AngularJS libraries.

More information about WebJars can be found at http://www.webjars.org/.

We will also be using RequireJS, which is a JavaScript module script loader, to manage the AngularJS module and public/javascripts/main.js, our main application JavaScript module. For more information about RequireJS, refer to their online documentation at http://requirejs.org/.

How to do it…

For this recipe, you need to perform the following steps:

  1. Create a new Play 2 web application project by using the...