From 9ef2190bab669cceb1ac0de44d8d43f64b17f971 Mon Sep 17 00:00:00 2001 From: codenamerana Date: Sun, 27 Dec 2015 20:28:51 +0530 Subject: [PATCH] Added a config variable for loading table once Added a config variable to force table load irrespective of bind-reload attribute value. Fix for Bug1 of https://github.com/Zizzamia/ng-tasty/issues/186 Example: loadOnce:true --- src/component/table.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/component/table.js b/src/component/table.js index bd94da2d..eb5ab0c8 100644 --- a/src/component/table.js +++ b/src/component/table.js @@ -32,6 +32,7 @@ angular.module('ngTasty.component.table', [ bootstrapIcon: false, bindOnce: true, loadOnInit: false, + loadOnce: false, iconUp: 'fa fa-sort-up', iconDown: 'fa fa-sort-down', listItemsPerPage: [5, 25, 50, 100], @@ -43,7 +44,7 @@ angular.module('ngTasty.component.table', [ .controller('TableController', function($scope, $attrs, $filter, tableConfig, tastyUtil) { var listScopeToWatch, initTable, newScopeName, initStatus, updateClientSideResource, updateServerSideResource, setDirectivesValues, - buildClientResource, buildUrl, paramsInitialCycle, initNow, loadOnInit, + buildClientResource, buildUrl, paramsInitialCycle, initNow, loadOnInit,loadOnce filterChangedPage; var vm = this; vm.$scope = $scope; @@ -394,6 +395,12 @@ angular.module('ngTasty.component.table', [ $scope.logs.updateServerSideResourceRunning = false; }); } + + if(vm.config.loadOnce) + { + updateServerSideResource(); + vm.config.loadOnce = false; + } if ($scope.reload) { $scope.reload = updateServerSideResource;