{"action":"created","issue":{"url":"https://api.github.com/repos/json-schema-form/angular-schema-form/issues/770","repository_url":"https://api.github.com/repos/json-schema-form/angular-schema-form","labels_url":"https://api.github.com/repos/json-schema-form/angular-schema-form/issues/770/labels{/name}","comments_url":"https://api.github.com/repos/json-schema-form/angular-schema-form/issues/770/comments","events_url":"https://api.github.com/repos/json-schema-form/angular-schema-form/issues/770/events","html_url":"https://github.com/json-schema-form/angular-schema-form/pull/770","id":178227246,"number":770,"title":"[Issue 769]: Fix retrieval of the correct Object during $destroy on elements within an Array","user":{"login":"doomie999","id":22141488,"avatar_url":"https://avatars.githubusercontent.com/u/22141488?v=3","gravatar_id":"","url":"https://api.github.com/users/doomie999","html_url":"https://github.com/doomie999","followers_url":"https://api.github.com/users/doomie999/followers","following_url":"https://api.github.com/users/doomie999/following{/other_user}","gists_url":"https://api.github.com/users/doomie999/gists{/gist_id}","starred_url":"https://api.github.com/users/doomie999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doomie999/subscriptions","organizations_url":"https://api.github.com/users/doomie999/orgs","repos_url":"https://api.github.com/users/doomie999/repos","events_url":"https://api.github.com/users/doomie999/events{/privacy}","received_events_url":"https://api.github.com/users/doomie999/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/json-schema-form/angular-schema-form/labels/needs:%20work","name":"needs: work","color":"e99695"},{"url":"https://api.github.com/repos/json-schema-form/angular-schema-form/labels/type:%20bug","name":"type: bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"joelwkent","id":3464839,"avatar_url":"https://avatars.githubusercontent.com/u/3464839?v=3","gravatar_id":"","url":"https://api.github.com/users/joelwkent","html_url":"https://github.com/joelwkent","followers_url":"https://api.github.com/users/joelwkent/followers","following_url":"https://api.github.com/users/joelwkent/following{/other_user}","gists_url":"https://api.github.com/users/joelwkent/gists{/gist_id}","starred_url":"https://api.github.com/users/joelwkent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelwkent/subscriptions","organizations_url":"https://api.github.com/users/joelwkent/orgs","repos_url":"https://api.github.com/users/joelwkent/repos","events_url":"https://api.github.com/users/joelwkent/events{/privacy}","received_events_url":"https://api.github.com/users/joelwkent/received_events","type":"User","site_admin":false},"assignees":[{"login":"joelwkent","id":3464839,"avatar_url":"https://avatars.githubusercontent.com/u/3464839?v=3","gravatar_id":"","url":"https://api.github.com/users/joelwkent","html_url":"https://github.com/joelwkent","followers_url":"https://api.github.com/users/joelwkent/followers","following_url":"https://api.github.com/users/joelwkent/following{/other_user}","gists_url":"https://api.github.com/users/joelwkent/gists{/gist_id}","starred_url":"https://api.github.com/users/joelwkent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelwkent/subscriptions","organizations_url":"https://api.github.com/users/joelwkent/orgs","repos_url":"https://api.github.com/users/joelwkent/repos","events_url":"https://api.github.com/users/joelwkent/events{/privacy}","received_events_url":"https://api.github.com/users/joelwkent/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2016-09-21T02:09:25Z","updated_at":"2016-10-18T00:11:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/json-schema-form/angular-schema-form/pulls/770","html_url":"https://github.com/json-schema-form/angular-schema-form/pull/770","diff_url":"https://github.com/json-schema-form/angular-schema-form/pull/770.diff","patch_url":"https://github.com/json-schema-form/angular-schema-form/pull/770.patch"},"body":"#### Description\r\n\r\nDuring a $destroy (e.g. when conditions evaluate to false), `form.key` is used to access the appropriate part of the Model in order to apply the DestroyStrategy.\r\n\r\nThis does not work for Elements within an Array, because `form.key` looks like this:\r\n`['array', '', 'property']`\r\nIn other words, it does not have a reference to the ArrayIndex of the Element (within which contains the property to be destroyed).\r\n\r\nMy fix was to make a copy of the `form.key` (in order to avoid breaking anything else that depends on its original format), and then update it so that it looks like this:\r\n`['array', '5', 'property']`\r\nWhere `'5'` here is just an example of the ArrayIndex.\r\n\r\nThis \"updated\" `form.key` is then used in the `sfSelect` to correctly access the appropriate part of the Model to be destroyed.\r\n\r\n#### Fixes Related issues\r\n- https://github.com/json-schema-form/angular-schema-form/issues/769\r\n\r\n#### Checklist\r\n- [x] I have read and understand the CONTRIBUTIONS.md file\r\n- [x] I have searched for and linked related issues\r\n- [ ] I have created test cases to ensure quick resolution of the PR is easier\r\n- [x] I am NOT targeting main branch\r\n- [x] I did NOT include the dist folder in my PR\r\n\r\n@json-schema-form/angular-schema-form-lead\r\n"},"comment":{"url":"https://api.github.com/repos/json-schema-form/angular-schema-form/issues/comments/254370736","html_url":"https://github.com/json-schema-form/angular-schema-form/pull/770#issuecomment-254370736","issue_url":"https://api.github.com/repos/json-schema-form/angular-schema-form/issues/770","id":254370736,"user":{"login":"Anthropic","id":1182507,"avatar_url":"https://avatars.githubusercontent.com/u/1182507?v=3","gravatar_id":"","url":"https://api.github.com/users/Anthropic","html_url":"https://github.com/Anthropic","followers_url":"https://api.github.com/users/Anthropic/followers","following_url":"https://api.github.com/users/Anthropic/following{/other_user}","gists_url":"https://api.github.com/users/Anthropic/gists{/gist_id}","starred_url":"https://api.github.com/users/Anthropic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anthropic/subscriptions","organizations_url":"https://api.github.com/users/Anthropic/orgs","repos_url":"https://api.github.com/users/Anthropic/repos","events_url":"https://api.github.com/users/Anthropic/events{/privacy}","received_events_url":"https://api.github.com/users/Anthropic/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T00:11:08Z","updated_at":"2016-10-18T00:11:08Z","body":"@doomie999 the code I added passes the index and array indices to the scope by adding a controller above the added items and then importing that data using require **?^^sfKeyController** into sfField. I have added the bejhaviour to array and tabarray."}}
{"actor":{"display_login":"Anthropic"}}