Answer the question
In order to leave comments, you need to log in
How to change colspan when angularJS window width changes?
Tell me how to change colspan using angular?
controller:
$window.onresize = function(){
$scope.colSpan = ($window.innerWidth <= 767) ? 4 : 6;
console.log('colSpan');
console.log($scope.colSpan);
};
<td colspan="{{colSpan}}" class="text-center">
Answer the question
In order to leave comments, you need to log in
I provide a working solution
$window.onresize = function(attrs){
$scope.colSpan = ($window.innerWidth <= 767) ? 4 : 6;
$scope.$apply(attrs.confirmAction);
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question