mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
[Forms] Communicate dirty state
Communicate dirty state out of generated forms; WTD-530.
This commit is contained in:
parent
77c1b150d9
commit
b31b4770d1
@ -2,10 +2,11 @@
|
||||
"platform/framework",
|
||||
"platform/core",
|
||||
"platform/representation",
|
||||
"platform/commonUI/browse",
|
||||
"platform/commonUI/edit",
|
||||
"platform/commonUI/dialog",
|
||||
"platform/commonUI/general",
|
||||
"platform/forms",
|
||||
|
||||
"example/forms",
|
||||
|
||||
"example/persistence"
|
||||
]
|
@ -1,7 +1,7 @@
|
||||
<label class="checkbox custom no-text">
|
||||
<input type="checkbox"
|
||||
name="{{name}}"
|
||||
ng-model="ngModel[name]"
|
||||
name="mctControl"
|
||||
ng-model="ngModel[field]"
|
||||
ng-disabled="ngDisabled">
|
||||
<em> </em>
|
||||
</label>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<select class='form-control input select'
|
||||
ng-model="ngModel[name]"
|
||||
ng-model="ngModel[field]"
|
||||
ng-options="o.name for o in options"
|
||||
name="name">
|
||||
<option value="" ng-if="!ngModel[name]">- Select One -</option>
|
||||
name="mctControl">
|
||||
<option value="" ng-if="!ngModel[field]">- Select One -</option>
|
||||
<span class='ui-symbol arw colorKey'>v</span>
|
||||
</select>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<span class='form-control shell'>
|
||||
<span class='field control'>
|
||||
<input type="text"
|
||||
ng-model="ngModel[name]"
|
||||
name="{{name}}">
|
||||
ng-model="ngModel[field]"
|
||||
name="mctControl">
|
||||
</span>
|
||||
</span>
|
||||
|
@ -18,23 +18,26 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class='controls'>
|
||||
<div class="wrapper" ng-if="row.control">>
|
||||
<div class="wrapper" ng-if="row.control">
|
||||
<ng-form name="mctFormInner">
|
||||
<mct-control key="row.control"
|
||||
ng-model="ngModel"
|
||||
ng-required="row.required"
|
||||
options="row.options"
|
||||
structure="row"
|
||||
name="{{row.key}}">
|
||||
field="row.key">
|
||||
</mct-control>
|
||||
</ng-form>
|
||||
</div>
|
||||
<div ng-repeat="item in row.items" class="validates">
|
||||
<ng-form name="mctFormInner">
|
||||
<mct-control key="item.control"
|
||||
ng-model="ngModel"
|
||||
ng-required="item.required"
|
||||
options="item.options"
|
||||
structure="item"
|
||||
name="{{item.key}}">
|
||||
structure="item">
|
||||
</mct-control>
|
||||
</ng-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -60,7 +60,7 @@ define(
|
||||
structure: "=",
|
||||
|
||||
// Name, as in "<input name="...
|
||||
name: "@"
|
||||
field: "="
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -21,8 +21,9 @@ define(
|
||||
|
||||
function controller($scope) {
|
||||
$scope.$watch("mctForm", function (mctForm) {
|
||||
console.log(JSON.stringify(mctForm));
|
||||
if ($scope.name) {
|
||||
$scope.$parent.mctForm = mctForm;
|
||||
$scope.$parent[$scope.name] = mctForm;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user