I have the following problem with angular custom directives. I have a modal dialog that gets filled with input elements. These input elements get filled using ng-repeat angular directive like this
<div ng-repeat="item in params">
<label>{{item.nombre}}{{item.valor}}</label>
<div class="input-group" ng-if="item.tipo=='DATE'">
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
<input type="text" name="{{item.nombre}}" class="form-control reportesFechas" ng-model="item.valor"
data-custom-datepicker data-date-format="dd/mm/yy" id="{{item.nombre}}">
</div>
</div>
data-custom-datepicker is my custom attribute. The params model gets filled via a service call to a java backend like this
appbsReportsParamsService.query({
q: "idReport="+id
}, function(data){
$scope.params = data.content;
})
The service call works OK because the final HTML is "correct" in terms of inputs gets generated. However data-custom-datepicker doesn't get applied. This is the HTML "ng-repeat" portion being generated:
<div class="input-group ng-scope" ng-if="item.tipo=='DATE'">
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
<input type="text" name="fecDesde" class="form-control reportesFechas hasDatepicker ng-pristine ng-valid ng-touched" ng-model="item.valor" data-custom-datepicker="" data-date-format="dd/mm/yy" id="fecDesde">
</div>
<div class="input-group ng-scope" ng-if="item.tipo=='DATE'">
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
<input type="text" name="fecHasta" class="form-control reportesFechas hasDatepicker ng-pristine ng-valid ng-touched" ng-model="item.valor" data-custom-datepicker="" data-date-format="dd/mm/yy" id="fecHasta">
</div>
So basically I want to know how to apply the directive after a async service call to populate the model.