[Forms] Support patterns

Support patterns for text fields, using the ng-pattern
directive. WTD-530.
This commit is contained in:
Victor Woeltjen
2014-11-28 14:08:33 -08:00
parent aaa0ff768d
commit 354327accc
3 changed files with 47 additions and 12 deletions

View File

@@ -23,23 +23,26 @@
</div>
<div class='controls'>
<div class="wrapper" ng-if="row.control">
<mct-control key="row.control"
ng-model="ngModel"
ng-required="row.required"
options="row.options"
structure="row"
field="row.key">
</mct-control>
<mct-control key="row.control"
ng-model="ngModel"
ng-required="row.required"
ng-pattern="getRegExp(row.pattern)"
options="row.options"
structure="row"
field="row.key">
</mct-control>
</div>
<div ng-repeat="item in row.items" class="validates">
<ng-form name="mctFormInner">
<ng-form name="mctFormItem">
<mct-control key="item.control"
ng-model="ngModel"
ng-required="item.required"
ng-pattern="getRegExp(item.pattern)"
options="item.options"
structure="item">
structure="row"
field="item.key">
</mct-control>
{{item.name}}
</ng-form>
</div>
</div>