I would like to define 4 different outputs. In my HTML I want to say how many columns I would like to show, then in JavaScript I would run this code if there are 4 columns:
<div class="col-md-3">
<h1>Content</h1>
</div>
<div class="col-md-3">
<h1>Content</h1>
</div>
<div class="col-md-3">
<h1>Content</h1>
</div>
<div class="col-md-3">
<h1>Content</h1>
</div>
Run this code if there are 3 columns:
<div class="col-md-4">
<h1>Content</h1>
</div>
<div class="col-md-4">
<h1>Content</h1>
</div>
<div class="col-md-4">
<h1>Content</h1>
</div>
Run this code if there 2 columns:
<div class="col-md-6">
<h1>Content</h1>
</div>
<div class="col-md-6">
<h1>Content</h1>
</div>
Run this code if there is 1 column:
<div class="col-md-12">
<h1>Content</h1>
</div>
Is there a way doing this with AngularJS?
ng-if="colCount == 2"and so on.col-md-class to 12/no of columns