score:1

Accepted answer

try adding a $scope.$apply() after $scope.d3data = data;

$scope.d3data = data;
$scope.$apply();

if this doesn't work, you can always pass a function down into the directive and set it to update the data and then manually call it from the controller:

so controller logic:

$scope.updatedirective = function () {}; // this will be overridden in directive

directive logic:

scope: {
  data: '=',
  update: '&updatedirective'
  label: '@'
}

scope.updatedirective = function () {
  scope.render(scope.data); // call to update function
};

markup:

  <div class="col-md-6">
    <div class="module">
      <div class="inner-module" ng-controller="downloadscloudctrl">
        <div class="module-graph">
          <d3-cloud data="d3data" update-directive="updatedirective"></d3-cloud>
        </div>
      </div>
    </div>
  </div>

Related Query

More Query from same tag