如何使用角度js刷新或重新加载某个函数上的特定div?

时间:2016-01-22 05:37:00

标签: javascript html angularjs

<div id="divId_graph" ></div>
<div class="graph" id="graph" style="margin-top:-15px"></div>

controller.js:

$('#graph').svg({ onLoad:drawIntro});

drawIntro是一个计算值的函数。当我通过改变一些输入值来回忆同一页面中的函数时,它不会调用。

1 个答案:

答案 0 :(得分:0)

$.ajax({

            type: "GET",

            url: "/templates/ch_div_content.html?loadPortion=graph",

            data: "partnerSelect="+$rootScope.partnerSelect,

            success: function(msg){

                if (box1) box1.remove();

                $("#divId_graph").html(msg);

            }

        });



the the ch-div-content.html is the part i want to reload and it is as  follows
<?php if ($loadPortion == 'graph'){ ?>                           

<script language="javascript">
if($( ".graph" )[1]!==undefined){
     $( ".graph" )[1].remove();
 }
</script>

 <div class="graph" id="graph" style="margin-top:25px">


</div>