@@ -512,7 +512,7 @@ angular.module('schemaForm').provider('schemaFormDecorators',
512
512
}
513
513
514
514
if ( scope . ngModel && error ) {
515
- if ( scope . ngModel . $setDirty ( ) ) {
515
+ if ( scope . ngModel . $setDirty ) {
516
516
scope . ngModel . $setDirty ( ) ;
517
517
} else {
518
518
// FIXME: Check that this actually works on 1.2
@@ -911,7 +911,7 @@ angular.module('schemaForm').provider('schemaForm',
911
911
return type [ 0 ] ;
912
912
}
913
913
return type ;
914
- }
914
+ } ;
915
915
916
916
//Creates an default titleMap list from an enum, i.e. a list of strings.
917
917
var enumToTitleMap = function ( enm ) {
@@ -1044,6 +1044,7 @@ angular.module('schemaForm').provider('schemaForm',
1044
1044
if ( ! f . titleMap ) {
1045
1045
f . titleMap = enumToTitleMap ( schema [ 'enum' ] ) ;
1046
1046
}
1047
+ f . trackBy = 'value' ;
1047
1048
options . lookup [ sfPathProvider . stringify ( options . path ) ] = f ;
1048
1049
return f ;
1049
1050
}
@@ -1237,6 +1238,10 @@ angular.module('schemaForm').provider('schemaForm',
1237
1238
obj . titleMap = canonicalTitleMap ( obj . titleMap ) ;
1238
1239
}
1239
1240
1241
+ if ( obj . type === 'select' ) {
1242
+ obj . trackBy = obj . trackBy || 'value' ;
1243
+ }
1244
+
1240
1245
//
1241
1246
if ( obj . itemForm ) {
1242
1247
obj . items = [ ] ;
@@ -1473,7 +1478,7 @@ angular.module('schemaForm').directive('sfArray', ['sfSelect', 'schemaForm', 'sf
1473
1478
// the outside so let's watch for that. We use an ordinary watch since the only case
1474
1479
// we're really interested in is if its a new instance.
1475
1480
scope . $watch ( 'model' + sfPath . normalize ( form . key ) , function ( value ) {
1476
- scope . modelArray = value ;
1481
+ list = scope . modelArray = value ;
1477
1482
} ) ;
1478
1483
1479
1484
// Since ng-model happily creates objects in a deep path when setting a
@@ -1874,7 +1879,7 @@ angular.module('schemaForm').directive('sfField',
1874
1879
}
1875
1880
1876
1881
if ( scope . ngModel && error ) {
1877
- if ( scope . ngModel . $setDirty ( ) ) {
1882
+ if ( scope . ngModel . $setDirty ) {
1878
1883
scope . ngModel . $setDirty ( ) ;
1879
1884
} else {
1880
1885
// FIXME: Check that this actually works on 1.2
0 commit comments