Git Product home page Git Product logo

Comments (6)

huntc avatar huntc commented on July 1, 2024

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.

mariussoutier avatar mariussoutier commented on July 1, 2024

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.

huntc avatar huntc commented on July 1, 2024

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.

mariussoutier avatar mariussoutier commented on July 1, 2024

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.

huntc avatar huntc commented on July 1, 2024

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.

huntc avatar huntc commented on July 1, 2024

I'm going to take care of this issue here:

webjars/angularjs#11

from angular-seed-play.

Related Issues (9)

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.