{"size": 700, "ext": "js", "max_stars_repo_path": "app/scripts/services/Item.js", "max_stars_repo_name": "CGally/blocitoffFE", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/scripts/services/Item.js", "max_issues_repo_name": "CGally/blocitoffFE", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/scripts/services/Item.js", "max_forks_repo_name": "CGally/blocitoffFE", "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": 22.5806451613, "max_line_length": 55, "alphanum_fraction": 0.5557142857}
(function() {
  function Item($firebaseArray) {
    var Item = {};
    var ref = firebase.database().ref().child("items");
    var items = $firebaseArray(ref);

    Item.all = items;

    Item.createItem = function(description, priority) {
        items.$add({
          description: description,
          createdAt: Date.now(),
          completed: false,
          expired: false,
          active: true,
          priority: priority
        });
    };
    Item.confirmCompleted = function(item) {
      item.completed = true;
      item.active = false;
      items.$save(item)
    }
    return Item;
  }

  angular
    .module('blocItOffFE')
    .factory('Item', ['$firebaseArray', Item]);
})();
