0

I would like to apply an ng-pattern validation on my input

<div ng-if="item.usage.dataType == 'integer' || item.usage.dataType == 'date'" ng-init="filter[item.ids]['dataType'] = item.usage.dataType">
    <input type="text" ng-model="filter.[item.ids]['value']" />
</div>

But I only want to validate the input if item.usage.dataType == 'date'

I've seen this answer but I have no way to know what is the dataType with this.

How can I make a conditional validation without repeating the DOM?

Thanks

Community
  • 1
  • 1
Hakim
  • 1,084
  • 11
  • 28

0 Answers0