Coder Social home page Coder Social logo

angular-seed-play's Introduction

angular-seed-play

This project illustrates how WebJars can be used along with requirejs in relation to the popular angular-seed project.

The main idea is to show how little impact there is on JavaScript when using it in the context of Play and WebJars. The project also illustrates the intrinsic support of JavaScript development from within Play. We hope that the sample serves to show that Play is not strongly opinionated about how JavaScript development is to be done, but that it can really help. Our goal when using Play is that you should not require other task runners or package management tools for your JavaScript development [1].

The following things enhance the regular angular-seed project:

  1. index.html does not require explicit script statements to load the other js files - we leverage requirejs to do this for us. This makes the maintenance of files easier by enforcing the DRY principle.
  2. There is a single script statement for loading requirejs from index.html and a data-main attribute declaring the JavaScript to invoke upon loading it. This declaration is entirely conventional requirejs.
  3. Each JavaScript file has an AMD define declaration which declares the AMD modules (these are different to angular modules - check out (this issue)[angular/angular.js#2078]). Using define() and require() is conventional for AMD usage.
  4. AngularJs is declared as a WebJar - check out the project/Build.scala file to see its declaration. requirejs is also declared this way so you can easily upgrade its version as new ones become available. By being brought in as a WebJar you have all of the advantages that artifact repositories including Maven and Ivy based ones bring; in particular dependency management.

[1] We are not there yet. Play 2.3 plans significant functionality to assist further including linting, unit testing, optimization and so forth.

angular-seed-play's People

Contributors

flurdy avatar huntc avatar jamesward avatar mariussoutier avatar michaelneale avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.