Note that there are some explanatory texts on larger screens.

plurals
  1. POPlay 2.1 and Angularjs : code organization
    text
    copied!<p>Trying to use <code>angular.js</code> and <code>Play Framework 2.1</code> altogether.</p> <p>My first step was to install <code>angular.js</code> and yeoman`: npm, bower, .grunt, ... a full js toolkit. Code organization which seemed "standard".</p> <p>Then I added Play 2.1 Scala version. Code layout follows the standard from PlayFramework</p> <p>When I want my <code>angular.js</code> services to talk to real REST actions I get <code>CORS</code> problems due to usage of different ports : 9000 (<code>yeoman</code>) and 9001 (<code>play run 9001</code>).</p> <p>Which are the options available? What are the solutions and why? (I don't think there is an unique or Best solution for this).</p> <p>The candidates, I know are :</p> <ol> <li><p>play-yeoman sbt plugins (I didn't succeed with my Windows environnement - be kind please). </p></li> <li><p>CORS workarounds (add .withheader to Play results).</p></li> <li><p><a href="http://www.webjars.org/" rel="nofollow">WebJars</a> providing "Maven-like" dependencies for JS libraries.</p></li> </ol> <p>One last important thing is running tests. We need to run the <code>angularjs</code> test suite (using Karma) easily and we need to run Scala tests too. And, if possible, that someone working with angular can use all the web resources available without too much worrying about its specific environment). The more standard the better, I would say.</p> <p>Update 1 : The question was meant to discuss the use cases for each solution : their constraints, their appeal, code organization and architecture with multiple applicatons accessing REST Services. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload