We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f22e961 commit 19a142aCopy full SHA for 19a142a
src/directives/sf-field.directive.js
@@ -46,18 +46,18 @@ sfPath, sfSelect) {
46
if(scope.completeKey !== scope.form.key) {
47
if (typeof scope.$index === 'number') {
48
key = key.concat(scope.$index);
49
- };
+ }
50
51
if(scope.form.key && scope.form.key.length) {
52
if(typeof key[key.length-1] === 'number' && scope.form.key.length >= 1) {
53
let trim = scope.form.key.length - key.length;
54
- scope.completeKey = key.concat(scope.form.key.slice(-trim));
55
- }
56
- else {
+ scope.completeKey =
+ trim > 0 ? key.concat(scope.form.key.slice(-trim)) : key;
+ } else {
57
scope.completeKey = scope.form.key.slice();
58
59
60
61
62
// If there is no key then there's nothing to return
63
if(!Array.isArray(scope.completeKey)) {
0 commit comments