{"size": 624, "ext": "js", "max_stars_repo_path": "dist/scripts/controllers/tasksCtrl.js", "max_stars_repo_name": "mrpennacchio/Bloc-Time", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dist/scripts/controllers/tasksCtrl.js", "max_issues_repo_name": "mrpennacchio/Bloc-Time", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/scripts/controllers/tasksCtrl.js", "max_forks_repo_name": "mrpennacchio/Bloc-Time", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.2, "max_line_length": 107, "alphanum_fraction": 0.6169871795}
angular.module('BlocTime', ["firebase"])
    .controller('tasksCtrl', ['$scope', 'Tasks', '$firebaseArray', function($scope, tasks, $firebaseArray){
    var ref = firebase.database().ref().child("tasks");

    $scope.tasks = $firebaseArray(ref);
    // add task to firebase array
    $scope.addTask = function(form){
      $scope.tasks.$add({
	       text: $scope.newTaskText,
         date: firebase.database.ServerValue.TIMESTAMP
      });
      $scope.newTaskText = ''; // reset input text to display nothing
    };

    // remove task
    $scope.removeTask = function(task){
	    $scope.tasks.$remove(task);
    };
}]);
