title: How to reload ngtable using $scope.tableParams.reload();?
body: <p>I am using ng-table in angular js. My problem is delete one record in my table the data is not reloaded. this is my code</p>
  
  <pre><code> myapp.controller('aamListAssignment', ['$scope', '$http', 'ngTableParams', function ($scope, $http, ngTableParams) {
  
          $scope.data = [];
          $scope.listPromise = null;
          $scope.$watch("data", function () {
              $scope.tableParams.reload();
          });    
  
          $scope.list = function () {
              $scope.listPromise = $http.get('./ccs/assignment/all').success(function (data) {
                  $scope.data = data;
                  $scope.tableParams = new ngTableParams({
                      page: 1, // show first page
                      count: 2           // count per page
                  }, {
                      counts: [],
                      total: $scope.data.length, // length of data
                      getData: function ($defer, params) {
                          $defer.resolve($scope.data.slice((params.page() - 1) * params.count(), params.page() * params.count()));
                      }
                  });
              });
          };
          $scope.removeAssignment = function (id) {
              $scope.value = true;
              $scope.Url = "./ccs/assignment/removeAssignment/" + id;
              $http.get($scope.Url).success(function (data) {
                  console.log('after delete: ' + $scope.id);
                 // $location.path('aam/listAssignment/');
                  $scope.list();
              });
          };
  
          $scope.list();
      }]);
  </code></pre>
  
  <p>Execute time two types of errors occurred in a console page that is</p>
  
  <pre><code>"Error: $scope.tableParams is undefined..............
  </code></pre>
  
  <p>and</p>
  
  <pre><code>"Error: h.$scope is null..........
  </code></pre>
  
  <p>please help me to this problem.</p>
  
  <p>I am using another way, this time reload is working,but pagination not working.the code is</p>
  
  <pre><code>myapp.controller('aamListAssignment', ['$scope', '$http', 'ngTableParams', function ($scope, $http, ngTableParams) {
  
      $scope.tableParams = {};
      $scope.data = [];
      $scope.listPromise = null;
      $scope.list = function () {
          $scope.listPromise = $http.get('./ccs/assignment/all').success(function (data) {
              $scope.data = data;
              $scope.tableParams.reload();
          });
  
      };
      $scope.tableParams = new ngTableParams({
          page: 1, // show first page
          count: 6           // count per page
      }, {
          counts: [],
          total: $scope.data.length, // length of data
          getData: function ($defer, params) {
              $defer.resolve($scope.data.slice((params.page() - 1) * params.count(), params.page() * params.count()));
          }
      });
  
      $scope.removeAssignment = function (id) {
          $scope.value = true;
          $scope.Url = "./ccs/assignment/removeAssignment/" + id;
          $http.get($scope.Url).success(function (data) {
              console.log('after delete: ' + $scope.id);
              $scope.list();
          });
      };
      $scope.list();
  
  }]);
  </code></pre>