'use strict';
/**
 * Implements directive for qusion.popover component.
 */
angular.module('qusion.ui.popover', [])
    .directive('qnPopover', [
        function() {
            return {
                link: function(scope, element, attr) {

                    var settings = { };
                    var getOptions = function() {
                        return angular.extend({ }, settings, scope.$eval(attr.qnPopover));
                    };

                    var init = function() {
                        var options = getOptions();
                        element.popover(options);
                    };

                    scope.$watch(getOptions, init, true);
                }
            };
        }
    ]);