Angularjs

app.directive("itemPopover",function($timeout){
    return {
        restrict : "A",
        link : function(scope,element,attrs){
            element.popover();
             
            var  createText = "<div class='hover' sadsdas style='position:absolute;top:50%;left:125px;400px;z-index:9999999;font-size:26px;color:#fff;text-align:center;'>请输入文本</div>";
            var con = angular.element(".app-content");
             
            element.on("click",function(){
                if(attrs.tag == "createText"){
                    console.log(con)
                    $timeout(function(){
                        con.append(createText);
                    });
                }
            });
             
        }
    }
});

原文地址:https://www.cnblogs.com/herd/p/5855773.html