Comments (6)
Hi @mariussoutier - the standard angularjs distribution comes bundled with many things. If you do something like:
jar tvf /usr/local/play-2.1.1/repository/cache/org.webjars/angularjs/jars/angularjs-1.0.5.jar
(depending on where your Play distro is)
...then you'll see what's available. Thus
define(["webjars!angular-cookies.js", function() {...
should be all that you need.
If there are things that you cannot find as a WebJar then please feel free to submit an issue/PR at the WebJars github repo. Thanks.
from angular-seed-play.
Thanks for your answer.
I do use define("cookies", ["webjars!angular-cookies.js"], function() {})
, but that alone doesn't guarantee the correct loading order. So often times, the app doesn't load because angular-cookies.js
loads too early and fails with Cannot call method 'module' of undefined
, because angular isn't defined yet.
from angular-seed-play.
Ah, yes, that's a problem. We need to enhance the angular webjar project so that it shims these other angular modules and declares their dependencies. Take a look at the bootstrap webjar src/main/resources to see what I mean. In bootstrap's case it declares a dependency on jQuery.
I'll reopen this and create a pr to attend to it (unless you beat me to it! ;-) ). Meanwhile if you declare a webjars!angular.js dependency in the define statement for the cookies module then you can work around the issue for now.
from angular-seed-play.
Strangely, even that doesn't seem to work. So far the only reliable way was to set priority and dependencies explicitly in requirejs.config()
.
from angular-seed-play.
Actually that makes sense as both angularjs-config.js and angularjs will be loaded in parallel.... you'll need to use requirejs.config for now.
from angular-seed-play.
I'm going to take care of this issue here:
from angular-seed-play.
Related Issues (9)
- Wiring additional web jars as Angular dependencies. HOT 14
- Demonstrate using requirejs optimized files? HOT 5
- Demonstrate testing angular code HOT 17
- Demonstrate automatically wiring up the webjars-requirejs.js of the dependencies files with play 2.3 HOT 5
- $locationProvider.html5Mode(true) HOT 3
- dependency to require.js web jar is required
- how to serve minized files HOT 1
- Please update to current Play version HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-seed-play.