'use strict';

var LibraryMainController = angular.module('libraries.controllers.main', [
    'system'
])
    .controller('LibraryMainController', [
        '$scope',
        '$location',
        '$filter',
        'System',
        'LibraryService',
        function ($scope, $location, $filter, System, LibraryService) {
            LibraryService.query().then(function (data) {
                $scope.libraries = data;
            });

            $scope.select = function (library) {
                $location.url('/libraries/' + library.ID);
            };
            
            $scope.back = function() {
                $location.url('/libraries');
            };
    
        }
    ]);