title: $ng-resource doesn't work?
body: <p>I'm new to AngularJS, I would like to update my <code>data.json</code> but that I don't know where my file <code>users.json</code> should be and I have this error: </p>
  
  <blockquote>
    <p>Error: $injector:modulerr
    <a href="http://errors.angularjs.org/1.3.14/$injector/modulerr?p0=myApp&amp;p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.3.14%2F%24injector%2Fmodulerr%3Fp0%3DngResource%26p1%3DError%253A%2520%255B%2524injector%253Anomod%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.3.14%252F%2524injector%252Fnomod%253Fp0%253DngResource%250A%2520%2520%2520%2520at%2520Error%2520(native)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.3.14%252Fangular.min.js%253A6%253A417%250A%2520%2520%2520%2520at%2520http%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.3.14%252Fangular.min.js%253A21%253A412%250A%2520%2520%2520%2520at%2520a%2520(http%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.3.14%252Fangular.min.js%253A21%253A53)%250A%2520%2520%2520%2520at%2520w.bootstrap%2520(http%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.3.14%252Fangular.min.js%253A21%253A296)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.3.14%252Fangular.min.js%253A35%253A116%250A%2520%2520%2520%2520at%2520s%2520(http%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.3.14%252Fangular.min.js%253A7%253A302)%250A%2520%2520%2520%2520at%2520g%2520(http%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.3.14%252Fangular.min.js%253A34%253A399)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.3.14%252Fangular.min.js%253A35%253A63%250A%2520%2520%2520%2520at%2520s%2520(http%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.3.14%252Fangular.min.js%253A7%253A302)%0A%20%20%20%20at%20Error%20(native)%0A%20%20%20%20at%20http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A6%3A417%0A%20%20%20%20at%20http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A35%3A320%0A%20%20%20%20at%20s%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A7%3A302)%0A%20%20%20%20at%20g%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A34%3A399)%0A%20%20%20%20at%20http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A35%3A63%0A%20%20%20%20at%20s%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A7%3A302)%0A%20%20%20%20at%20g%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A34%3A399)%0A%20%20%20%20at%20ab%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A38%3A135)%0A%20%20%20%20at%20d%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.14%2Fangular.min.js%3A17%3A381" rel="nofollow">http://errors.angularjs.org/1.3.14/$injector/modulerr?p0</a></p>
  </blockquote>
  
  <p>Heres my code :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      var app = angular.module('myApp', ['ngResource']);
  
      app.factory('User', ['$resource',
                        function($resource){
                            return $resource('/users/:userId', {userId:'@id'},
                              {
                                  'update': {method: 'PUT'}
                              }
                            );
                        }
                      ]);
      app.controller('UsersCtrl', function ($scope, User) {
            $scope.users = User.query();
            $scope.validate=function(user) {
                user.$update();
            }
            $scope.delete=function(user) {
                user.$delete();
            }
            $scope.create = function (newUserName) {
                var user = new User();
                user.name = newUserName;
                user.$save();
                $scope.users.push(user);
            }
        });
  
  &lt;/script&gt;
  &lt;body ng-app="myApp" ng-controller="UsersCtrl"&gt;
  
          &lt;ul&gt;
                &lt;li ng-repeat="user in users"&gt;
                  &lt;input type="text" ng-model="user.name" /&gt;
                  &lt;button ng-click="validate(user)"&gt;Valider&lt;/button&gt;
                  &lt;button ng-click="delete(user)"&gt;Supprimer&lt;/button&gt;
                &lt;/li&gt;
          &lt;/ul&gt;
  Nouveau utilisateur :
      &lt;input type="text" ng-model="newUserName" /&gt;
      &lt;button ng-click="create(newUserName)"&gt;Créer&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Anyone have an idea please?</p>