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

Function Sessions

public/app/sessions-controller.js:3–23  ·  view source on GitHub ↗
($scope, $http, SessionService, api)

Source from the content-addressed store, hash-verified

1var module = angular.module('scorekeep');
2module.controller('SessionsController', Sessions);
3function Sessions($scope, $http, SessionService, api) {
4 $scope.sessions = SessionService.query();
5
6 $scope.name = "my session";
7 $scope.username = "my name";
8 $scope.createSession = function () {
9 var session = new SessionService();
10 session.$save(function() {
11 session.name = $scope.name;
12 session.owner = $scope.username;
13 session.$update({ id: session.id }, function() {
14 $scope.sessions.push(angular.copy(session));
15 })
16 }
17 )};
18 $scope.deleteSession = function (index) {
19 var sessionId = $scope.sessions[index].id;
20 $http.delete( api + 'session/' + sessionId);
21 $scope.sessions.splice(index, 1);
22 }
23}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected