Skip to content

Instantly share code, notes, and snippets.

@stevenabrooks
Created January 8, 2014 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenabrooks/8318817 to your computer and use it in GitHub Desktop.
Save stevenabrooks/8318817 to your computer and use it in GitHub Desktop.
angular.js module for app
angular.module("User", ["ngResource"])
function UserController($scope, $resource) {
User = $resource("/users.json")
$scope.users = User.query();
$scope.addUser = function() {
entry = User.save({name:$scope.newUser.name})
$scope.users.push(entry);
$scope.newUser.name = ';'
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment