Sha256: 99f7c188a840c201f406c0d8c66b4faa1dc238304e36482e8fc46330d36ce102

Contents?: true

Size: 1021 Bytes

Versions: 2

Compression:

Stored size: 1021 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.deleteItem = function(todo) {
        todo.archieved = true;
        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

Version Path
todo_rails-0.1.7 test/dummy/tmp/cache/assets/development/sprockets/v3.0/iJjYYJk0thA2Sr69BqFLswUD7L1yLlY-Bpb59veIqr8.cache
todo_rails-0.1.6 test/dummy/tmp/cache/assets/development/sprockets/v3.0/iJjYYJk0thA2Sr69BqFLswUD7L1yLlY-Bpb59veIqr8.cache