MCPcopy Index your code
hub / github.com/aws-samples/eb-java-scorekeep / User

Function User

public/app/user-controller.js:3–21  ·  view source on GitHub ↗
($scope, $http, UserService, api)

Source from the content-addressed store, hash-verified

1var module = angular.module('scorekeep');
2module.controller('UserController', User);
3function User($scope, $http, UserService, api) {
4 $scope.users = UserService.query();
5
6 $scope.username = "my name";
7 $scope.createUser = function () {
8 user = new UserService();
9 user.$save(function() {
10 user.name = $scope.username;
11 user.$update({ id: user.id }, function() {
12 $scope.users.push(angular.copy(user));
13 })
14 }
15 )};
16 $scope.deleteUser = function (index) {
17 var userId = $scope.users[index].id;
18 $http.delete( api + 'user/' + userId);
19 $scope.users.splice(index, 1);
20 }
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected