app.directive('selectedMeals',[function(){
  return {
    replace: true,
    resctrict: 'E',
    templateUrl: 'app/views/selected-meals.html',
    scope: {
      meals: '=',
    },
    controller: function($scope){
      var ref = firebase.database().ref().child('meals');
      $scope.unselect = function(i){
        var keys = Object.keys($scope.meals);
        $scope.meals[keys[i]].isSelected = false;
        ref.child(keys[i]).set($scope.meals[keys[i]]);
      }
    }
  }
}])
