Sa E Chowdary Sa E Chowdary - 3 months ago 39
AngularJS Question

how to refresh or reload a particular div on some function using angular js?

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


controller.js:

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


The
drawIntro
is a function which calculate values.It's not calling when I recall the function with in same page by change some input values.

Answer
$.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>
Comments