<div ng-repeat="column in columns">
<div ng-if="column.new">
{{ contador = contador + 1 }}
<span ng-if="contador === 1">
<div class="alert alert-danger">TESTDASDALGO</div>
</span>
<span ng-if="contador > 1">
{{ contador = 0 }}
</span>
</div>
</div>
The values are being printed between colchetes
.
Another question:
- Should logic be done on the front? I have a lot of conditional on my project, it will probably be pretty confusing ... (Is there another way to do it?)
Is it possible to do something like the one I wrote below?
var contador = 0;
angular.forEach($scope.columns, function(column){
if(column.new){
contador++;
if(contador === 1){
include('umarquivo.html');
}
if(contador > 1){
'</div>'; //fechar uma div
contador = 0;
}
}
});