var app = angular.module('app', []);

app.controller('appController', function appController($scope,$http) {
  $scope.products = {};
  $scope.focusedProduct = null;
    $scope.productOrder = ['wheels', 'pedals', 'shifters'];

  $http.get('js/data.json').then(function(res){
    console.log(res.data);
    $scope.products = res.data;
  });

  $scope.categoryFilter = function(category){
    return function(product){
      return product.category == category;
    }
  }

  $scope.focusProduct = function(product){
    $scope.focusedProduct = product;
  }
});
