Sha256: afece5de18a1457bfdbaf70721396f97967c87bbc1d46cd4bb83eb418b8c1d36
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
I" (function() { angular.module('todoRails.controllers').controller('todoCtrl', [ '$scope', 'Restangular', function($scope, Restangular) { var todos; todos = Restangular.all('tasks'); $scope.saveTodo = function(todo) { return todo.save(); }; $scope.deleteItem = function(todo) { todo.archieved = true; todo.save(); return $scope.reload(); }; $scope.reload = function() { return $scope.todos = todos.getList().$object; }; $scope.reload(); $scope.addTodo = function() { var todo; todo = { title: $scope.todoText, completed: false }; todos.post(todo); $scope.todoText = ''; return $scope.reload(); }; return $scope.remaining = function() { var count; count = 0; angular.forEach($scope.todos, function(todo) { return count += todo.completed ? 0 : 1; }); return count; }; } ]); }).call(this); :ET
Version data entries
2 entries across 2 versions & 1 rubygems