angular.module('bravoUiPopover', [])
    .directive("bravoPopover", function($compile, $position, $sce){
        // $parse : ng表达式 {{1+2}} {{text}}
        // $compile : 编译一段html字符串(可以包括ng表达式)
        return {
            restrict: "A",
            scope: {
                confirm: '&bravoPopoverConfirm'
            },
            compile: function (elem, attr) {
                var confirm_template = attr['bravoPopoverConfirm'] ? '' +
                            'Confirm ' +
                            'Cancel' +
                        '' : '';
                var template =
                    '
' +
                        '
' +
                        '
{{title}}
' +
                        '
' +
                        '
' +
                        '
' +
                             confirm_template +
                        '
' +
                    '