diff --git a/src/stSelectFilter.js b/src/stSelectFilter.js index 97b5d946..d1896835 100644 --- a/src/stSelectFilter.js +++ b/src/stSelectFilter.js @@ -41,10 +41,20 @@ ng.module('smart-table') // options as array of objects, eg: [{label:'green', value:true}, {label:'red', value:false}] scope.options = scope.attrOptions.slice(0); // copy values + + // keep watching if the options change outside of the table + scope.$watch("attrOptions", function() { + scope.options = scope.attrOptions.slice(0); + }); } else { // options as simple array, eg: ['apple', 'banana', 'cherry', 'strawberry', 'mango', 'pineapple']; scope.options = getOptionObjectsFromArray(scope.attrOptions); + + // keep watching if the options change outside of the table + scope.$watch("attrOptions", function() { + scope.options = getOptionObjectsFromArray(scope.attrOptions); + }); } } else { if (angular.isUndefined(scope.predicate) || scope.predicate === '') {