I am using custom directive to refresh my page. I have coded my UI with D3. 
Its a simple graph comprised of nodes and links  Here is what I am trying 
to do. 

When I click on particular node of graph it expands into its sub graph and 
so on. For this following is the controller


*vrmUI.controller('CompleteViewController', function($scope,$location, 
$rootScope, $route) {
    // Assigning data 
    // onDeviceClick is called when node of graph is clicked. 


    $scope.onDeviceClick = function(item){
        $rootScope.pageContextObject = $route.current.data;
        $scope.clickedItem=item;
        $scope.completeObject =//JSON Data
        $scope.loadExpandedView=true;
        $scope.showExpandedView=true;
    };*
});


Corresponding html is

<div class="content-panel clearfix">

    <div id="topoheader" style="font:12px sans-serif"></div>
        // expandedView directive should get called when ever control goes 
inside onDeviceClick.

        <expanded-view ng-show="showExpandedView"
            ng-if="loadExpandedView" clicked-rack="clickedItem"  
network-data="completeObject"
            device-click="onDeviceClick(item)"></expanded-views>    
    </div></div>

device-click is called on click on nodes of the graph.
And directive is
vrmUI.directive('expandedView',function(){ 
    function link(scope,el,attr){
     // Processing when clicked
    }
    return{
        restrict : 'E',
        link: link,
        scope : {
            clickedItem : '=',
            onDeviceClick : '&deviceClick'
        }
    };});

Question:

When I click once it works perfectly but when I click on other nodes of 
graph I can see control going inside $scope.onDeviceClick = function(item){ 
but my directive not getting called as happened in first case. Is there 
anyway by which I can make this happen? Please let me know if you need more 
details or question is unclear.

Thanks


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to