angular.module('films', [])
    .controller('AccueilCtrl', AccueilCtrl)
    .controller('DetailsCtrl', DetailsCtrl)
    .controller('RechercheCtrl', RechercheCtrl)
    .controller('FavorisCtrl', FavorisCtrl)
    .controller('VisionnerCtrl', VisionnerCtrl)
    .service('FilmSvc', FilmSvc)
    .service('FavorisSvc', FavorisSvc)
    .directive('filmDirective', FilmDirective)
    .config(function ($stateProvider) {
        $stateProvider
            .state('tabs.listeFilms', {
                url: '/films/liste?titre&annee&type',
                views: {
                    'tab-films': {
                        templateUrl: 'templates/liste.html',
                        controller: 'AccueilCtrl as AccueilCtrl'
                    }
                }
            })
            .state('tabs.detailsFilm', {
                url: '/films/details/:idFilm',
                views: {
                    'tab-films': {
                        templateUrl: 'templates/details.html',
                        controller: 'DetailsCtrl as DetailsCtrl'
                    }
                }
            })
            .state('tabs.rechercheFilm', {
                url: '/films/recherche',
                views: {
                    'tab-films': {
                        templateUrl: 'templates/recherche.html',
                        controller: 'RechercheCtrl as RechercheCtrl'
                    }
                }
            })
            .state('tabs.favoris', {
                url: '/favoris',
                views: {
                    'tab-favoris': {
                        templateUrl: 'templates/favoris.html',
                        controller: 'FavorisCtrl as FavorisCtrl'
                    }
                }
            })
            .state('tabs.visionner', {
                url: '/visionner',
                views: {
                    'tab-favoris': {
                        templateUrl: 'templates/visionner.html',
                        controller: 'VisionnerCtrl as VisionnerCtrl'
                    }
                }
            });
    });