Skip to content

Commit 8de9159

Browse files
committed
oops extra () can be bad sometimes
1 parent 7517ff8 commit 8de9159

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

dist/schema-form.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ angular.module('schemaForm').provider('schemaFormDecorators',
512512
}
513513

514514
if (scope.ngModel && error) {
515-
if (scope.ngModel.$setDirty()) {
515+
if (scope.ngModel.$setDirty) {
516516
scope.ngModel.$setDirty();
517517
} else {
518518
// FIXME: Check that this actually works on 1.2
@@ -911,7 +911,7 @@ angular.module('schemaForm').provider('schemaForm',
911911
return type[0];
912912
}
913913
return type;
914-
}
914+
};
915915

916916
//Creates an default titleMap list from an enum, i.e. a list of strings.
917917
var enumToTitleMap = function(enm) {
@@ -1044,6 +1044,7 @@ angular.module('schemaForm').provider('schemaForm',
10441044
if (!f.titleMap) {
10451045
f.titleMap = enumToTitleMap(schema['enum']);
10461046
}
1047+
f.trackBy = 'value';
10471048
options.lookup[sfPathProvider.stringify(options.path)] = f;
10481049
return f;
10491050
}
@@ -1237,6 +1238,10 @@ angular.module('schemaForm').provider('schemaForm',
12371238
obj.titleMap = canonicalTitleMap(obj.titleMap);
12381239
}
12391240

1241+
if(obj.type === 'select') {
1242+
obj.trackBy = obj.trackBy || 'value';
1243+
}
1244+
12401245
//
12411246
if (obj.itemForm) {
12421247
obj.items = [];
@@ -1473,7 +1478,7 @@ angular.module('schemaForm').directive('sfArray', ['sfSelect', 'schemaForm', 'sf
14731478
// the outside so let's watch for that. We use an ordinary watch since the only case
14741479
// we're really interested in is if its a new instance.
14751480
scope.$watch('model' + sfPath.normalize(form.key), function(value) {
1476-
scope.modelArray = value;
1481+
list = scope.modelArray = value;
14771482
});
14781483

14791484
// Since ng-model happily creates objects in a deep path when setting a
@@ -1874,7 +1879,7 @@ angular.module('schemaForm').directive('sfField',
18741879
}
18751880

18761881
if (scope.ngModel && error) {
1877-
if (scope.ngModel.$setDirty()) {
1882+
if (scope.ngModel.$setDirty) {
18781883
scope.ngModel.$setDirty();
18791884
} else {
18801885
// FIXME: Check that this actually works on 1.2

0 commit comments

Comments
 (0)