(function(){
    'use strict';

    angular
    .module('controleApp')
    .directive('accordion', accordion);

    function accordion() {
        var directive = {
            restrict: 'A',
            replace: true,
            link: link,
        };

        return directive;

        function link(scope, element, attr, ctrl) {

          element.on('click',function(){
            $(this).toggleClass('open');
            $(this).next().slideToggle('fast');
          });
        }
    }
})();
