I'm using this jquery plugin to make the divs height the same. For the plugin to work I have to add equalheight
to the divs that I want to have equal height.It works when the divs are not generated by ng-repeat.
How to make all the divs that was generated by ng-repeat the same height?
html
<div class="col-md-4" ng-repeat="dept in mainCtrl.departments" ng-hide="filteredCareers.length == 0">
<div class="job_list_box" ng-class="{'equalheight': filteredCareers.length > 0 }">
<div class="job_list_icon">
<img ng-src="{{dept.icon}}" alt="{{dept.name}}">
</div>
<h4 class="job_list-box-title">{{dept.name}}</h4>
<ul class="job_list">
<li ng-repeat="hiring in mainCtrl.careers | filter:dept.name as filteredCareers">
<a href="#" data-toggle="modal" data-target="#job-modal-{{hiring.id}}">{{hiring.name}}</a>
</li>
</ul>
</div>
</div>
controller
var app = angular.module('myApp', [])
app.controller('MainController', function ($scope, $http) {
var self = this;
$http({
method: 'GET',
url: 'json/departments-archives.json'
}).then(function (response) {
self.departments = response.data;
}, function () { console.log('Error'); });
$http({
method: 'GET',
url: 'json/careers-archives.json'
}).then(function (response) {
self.careers = response.data;
}, function () { console.log('Error'); });
});
I tried using setTimeout
then I added {{mainCtrl.setHeight}}
on the div with the class job_list_box
but it didn't work.
setTimeout(function(){
self.setHeight = "equalheight"
},100)
I also tried other solutions that I found online like angular plugins angular-vertilize, the flexbox approach..etc but none of it worked.