0
  $scope.gridconfig.getData = function (e) {
            ajaxCall.get('something?Id=' + $scope.clientModel.Id).then(function (data) {
                if (!data.IsError) {
                    $scope.result = data.Result;
                    $scope.gridconfig.ds = data.Result;
                    $scope.gridconfig.dataCount = data.Result.length;

                    e.success({ data: data.Result, total: $scope.gridconfig.dataCount });
                } else {

                    alertify.error(data.Message);
                }
            });
        }

        function loadGrid() {
            $timeout(function() {
                $rootScope.$broadcast('Grid');
            },1000);
        }

In js file after broadcast, getData is not fired. I have to call getData function whenever broadcast is called. Please help me

Pooja
  • 1

1 Answers1

0
$scope.$on('Gird', function (event, data) {
 loadGrid(); resizeGrid();
  });

$emit dispatches an event upwards ... $broadcast dispatches an event downwards

$rootScope.$broadcast vs. $scope.$emit

Community
  • 1
  • 1
Manikandan Velayutham
  • 2,228
  • 1
  • 15
  • 22