@@ -391,7 +391,7 @@ return /******/ (function(modules) { // webpackBootstrap
391391 }
392392 } ;
393393
394- var _build = function _build ( items , decorator , templateFn , slots , path , state , lookup , index ) {
394+ var _build = function _build ( items , decorator , templateFn , slots , path , state , lookup ) {
395395 state = state || { } ;
396396 state = state || { } ;
397397 lookup = lookup || Object . create ( null ) ;
@@ -444,8 +444,8 @@ return /******/ (function(modules) { // webpackBootstrap
444444 path : path + '[' + index + ']' ,
445445
446446 // Recursive build fn
447- build : function build ( items , path , state , index ) {
448- return _build ( items , decorator , templateFn , slots , path , state , lookup , index ) ;
447+ build : function build ( items , path , state ) {
448+ return _build ( items , decorator , templateFn , slots , path , state , lookup ) ;
449449 }
450450
451451 } ;
@@ -556,9 +556,16 @@ return /******/ (function(modules) { // webpackBootstrap
556556
557557 //Normalise names and ids
558558 scope . fieldId = function ( prependFormName , omitArrayIndexes ) {
559+ var key = scope . parentKey || [ ] ;
559560 if ( scope . form . key ) {
560- var formName = prependFormName && formCtrl && formCtrl . $name ? formCtrl . $name : undefined ;
561- return sfPath . name ( scope . form . key , '-' , formName , omitArrayIndexes ) ;
561+ if ( typeof key [ key . length - 1 ] === 'number' ) {
562+ var combinedKey = key . concat ( scope . form . key . slice ( - 1 ) ) ;
563+ var formName = prependFormName && formCtrl && formCtrl . $name ? formCtrl . $name : undefined ;
564+ return sfPath . name ( combinedKey , '-' , formName , omitArrayIndexes ) ;
565+ } else {
566+ var formName = prependFormName && formCtrl && formCtrl . $name ? formCtrl . $name : undefined ;
567+ return sfPath . name ( scope . form . key , '-' , formName , omitArrayIndexes ) ;
568+ }
562569 } else {
563570 return '' ;
564571 }
@@ -2756,7 +2763,7 @@ return /******/ (function(modules) { // webpackBootstrap
27562763
27572764 //Normalise names and ids
27582765 scope . fieldId = function ( prependFormName , omitArrayIndexes ) {
2759- var key = scope . parentKeyTest || [ ] ;
2766+ var key = scope . parentKey || [ ] ;
27602767 if ( scope . form . key ) {
27612768 if ( typeof key [ key . length - 1 ] === 'number' ) {
27622769 var combinedKey = key . concat ( scope . form . key . slice ( - 1 ) ) ;
@@ -3384,6 +3391,15 @@ return /******/ (function(modules) { // webpackBootstrap
33843391 scope . arrayIndex = Number ( attrs . sfIndex ) ;
33853392 scope . arrayIndices = scope . arrayIndices || [ ] ;
33863393 scope . arrayIndices = scope . arrayIndices . concat ( scope . arrayIndex ) ;
3394+ scope . $i = scope . arrayIndices ;
3395+ scope . path = function ( modelPath ) {
3396+ var i = - 1 ;
3397+ modelPath = modelPath . replace ( / \[ \] / gi, function ( matched ) {
3398+ i ++ ;
3399+ return scope . $i [ i ] ;
3400+ } ) ;
3401+ return modelPath ;
3402+ } ;
33873403 }
33883404 } ;
33893405 } ;
0 commit comments