[Forms] Handle required flag in composite controls

Handle the ng-required flag in composite controls.
WTD-593.
This commit is contained in:
Victor Woeltjen 2014-12-03 15:51:42 -08:00
parent d54524a96c
commit 6a6797bf53
2 changed files with 7 additions and 9 deletions

View File

@ -18,15 +18,14 @@
"items": [ "items": [
{ {
"name": "Width (px)", "name": "Width (px)",
"control": "textfield", "control": "textfield"
"pattern": "^(\\d*[1-9]\\d*)?$"
}, },
{ {
"name": "Height (px)", "name": "Height (px)",
"control": "textfield", "control": "textfield"
"pattern": "^(\\d*[1-9]\\d*)?$"
} }
], ],
"pattern": "^(\\d*[1-9]\\d*)?$",
"property": "preferredSize", "property": "preferredSize",
"conversion": "number[]" "conversion": "number[]"
}, },
@ -36,15 +35,14 @@
"items": [ "items": [
{ {
"name": "Horizontal grid (px)", "name": "Horizontal grid (px)",
"control": "textfield", "control": "textfield"
"pattern": "^(\\d*[1-9]\\d*)?$"
}, },
{ {
"name": "Vertical grid (px)", "name": "Vertical grid (px)",
"control": "textfield", "control": "textfield"
"pattern": "^(\\d*[1-9]\\d*)?$"
} }
], ],
"pattern": "^(\\d*[1-9]\\d*)?$",
"property": "layoutGrid", "property": "layoutGrid",
"conversion": "number[]" "conversion": "number[]"
}, },

View File

@ -1,7 +1,7 @@
<ng-form name="mctFormItem" ng-repeat="item in structure.items"> <ng-form name="mctFormItem" ng-repeat="item in structure.items">
<mct-control key="item.control" <mct-control key="item.control"
ng-model="ngModel[field]" ng-model="ngModel[field]"
ng-required="item.required" ng-required="ngRequired"
ng-pattern="ngPattern" ng-pattern="ngPattern"
options="item.options" options="item.options"
structure="row" structure="row"