Sha256: db3fa59f2f1d33c9c1cad42009f0ac31a1fd6b8034a771480aa150554b6376f8
Contents?: true
Size: 910 Bytes
Versions: 2
Compression:
Stored size: 910 Bytes
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.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