Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix embedded list validation #1286

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix my stupidity
  • Loading branch information
SzHeJason committed Jan 7, 2017
commit 550798a94b7d2d9d40d29cbe071cf28db4396f85
5 changes: 1 addition & 4 deletions src/javascripts/ng-admin/Crud/field/maEmbeddedListField.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ export default function maEmbeddedListField() {
scope.remove = entry => {
scope.entries = scope.entries.filter(e => e !== entry);
};
scope.getForm = function (formName) {
return scope.$parent.form[formName] || scope[formName];
}
scope.$watch('entries', (newEntries, oldEntries) => {
if (newEntries === oldEntries) {
return;
Expand All @@ -66,7 +63,7 @@ export default function maEmbeddedListField() {
<a class="btn btn-default btn-sm" ng-click="remove(entry)"><span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>&nbsp;<span translate="REMOVE"></span></a>
</div>
<div class="form-field form-group" ng-repeat="field in ::fields track by $index">
<ma-field field="::field" value="entry.values[field.name()]" entry="entry" entity="::targetEntity" form="getForm(formName)" datastore="::datastore()"></ma-field>
<ma-field field="::field" value="entry.values[field.name()]" entry="entry" entity="::targetEntity" form="$parent[formName]" datastore="::datastore()"></ma-field>
</div>
<hr/>
</ng-form>
Expand Down