I have the following JSON array in my controlle
$scope.companyExcelColumns = [
{
label: 'Name', checked: true, disabled: true, id:'nameExcel'
},
{
label: 'value', checked: true, disabled: $scope.records > 1000 ? true : false, id: 'valueExcel'
}
];
Initially the $scope.records is 0, later on it is changing but the the disabled attribute is not updating, is there a workaround ?
Thanks
this is not a common angular question but rather a programming question. of course value of disabled will not change. it is calculated once and done for.
You could use $watch and watch changes on $scope.records object. when this object changes you can reassign value of disabled.
$scope.$watch('records', function(){ disabled = $scope.records.length > 1000})
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments