Giter Club home page Giter Club logo

Comments (2)

jmdobry avatar jmdobry commented on July 30, 2024

@ctampak aProvider seems to indicate that you minified your code without using the array-injection syntax.

Minification-safe example:

angular.module('myApp')
  .controller('MyCtrl', ['DS', function (DS) {
    // do stuff
  }]);

The minified version of this would be something like:

angular.module('myApp').controller('MyCtrl', ['DS', function (a) {}])

The named parameter "DS" indicates that Angular should use the DSProvider to inject the dependency. If you didn't use the array-injection syntax then the minified code would look like this:

angular.module('myApp').controller('MyCtrl', function (a) {})

Without the named "DS" parameter Angular's only choice is to try to inject the dependency using the aProvider, which doesn't exist.

Multiple dependencies would get munged by the minifier like this:

angular.module('myApp').controller('MyCtrl', function (a, b, c, d, e) {})

And as you can see, Angular would not be able to successfully inject those dependencies without the named parameters specifying what should be injected.

Also, if you were using angular.min.js, try using just angular.js.

from js-data-angular.

ctampak avatar ctampak commented on July 30, 2024

I was already using the array-injection syntax, and my angular was the unminified one.

What I changed was the version of angular-data. From the minified version I used the uncompressed and the problem seems to be gone now.
My bad since I was developing with the minified version and didn't occur to me that that might be the problem.

Thank you very much for your immediate response.

from js-data-angular.

Related Issues (20)

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.