Sha256: 27ce2c72999671d10d3c5ccd1b664a256c0391763815b9d84a6c32b14a5a6e42
Contents?: true
Size: 1 KB
Versions: 2
Compression:
Stored size: 1 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 = trusted; return todo.save(); }; $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