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;width: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);
                    });
                }
            });
             
        }
    }
});

posted @ 2016-09-09 10:58  西北逍遥  阅读(135)  评论(0编辑  收藏  举报