{"action":"created","issue":{"url":"https://api.github.com/repos/triniwiz/nativescript-pager/issues/67","repository_url":"https://api.github.com/repos/triniwiz/nativescript-pager","labels_url":"https://api.github.com/repos/triniwiz/nativescript-pager/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/triniwiz/nativescript-pager/issues/67/comments","events_url":"https://api.github.com/repos/triniwiz/nativescript-pager/issues/67/events","html_url":"https://github.com/triniwiz/nativescript-pager/issues/67","id":327520375,"number":67,"title":"insert/remove objects with array.splice doesn't work fine IOS","user":{"login":"LauraNavarroGalvan","id":39338495,"avatar_url":"https://avatars1.githubusercontent.com/u/39338495?v=4","gravatar_id":"","url":"https://api.github.com/users/LauraNavarroGalvan","html_url":"https://github.com/LauraNavarroGalvan","followers_url":"https://api.github.com/users/LauraNavarroGalvan/followers","following_url":"https://api.github.com/users/LauraNavarroGalvan/following{/other_user}","gists_url":"https://api.github.com/users/LauraNavarroGalvan/gists{/gist_id}","starred_url":"https://api.github.com/users/LauraNavarroGalvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LauraNavarroGalvan/subscriptions","organizations_url":"https://api.github.com/users/LauraNavarroGalvan/orgs","repos_url":"https://api.github.com/users/LauraNavarroGalvan/repos","events_url":"https://api.github.com/users/LauraNavarroGalvan/events{/privacy}","received_events_url":"https://api.github.com/users/LauraNavarroGalvan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-05-29T23:21:32Z","updated_at":"2018-05-30T13:22:33Z","closed_at":null,"author_association":"NONE","body":"I'm trying to insert an object in a certain index and eliminating a specific object depending on what I need, but this does not work well in IOS. my variable BehaviorSubject is fine but in the view it doesn't appear as it should. this is my code:\r\n\r\nif (checkboxOption.trigger && checkboxOption.option_selected == true) {\r\nlet trigger = []; \r\n\t\t\ttrigger = this.getCorrectStructureForm(checkboxOption.trigger);\r\n\t\t\tlet newItems = (<BehaviorSubject<any>>this.formItems).value;\r\n\t\t\ttrigger.forEach(newQuestion => {\r\n\t\t\t\tnewItems.splice(indexPage+1, 0, newQuestion);\r\n\t\t\t});\r\n\t\t\tthis.formItems.next(newItems);\r\n\t\t\tthis.numItems = this.formItems.value.length;\r\n\t\t} else if(checkboxOption.trigger && checkboxOption.option_selected == false) {\r\n\t\t\tlet removeItems = (<BehaviorSubject<any>>this.formItems).value;\r\n\t\t\tcheckboxOption.trigger.forEach(removeQuestion => {\r\n\t\t\t\tlet indexRemove = removeItems.findIndex(item => item.fuid === removeQuestion.fuid);\r\n\t\t\t\tremoveItems.splice(indexRemove, 1);\r\n\t\t\t});\r\n\t\t\tthis.formItems.next(removeItems);\r\n\t\t\tthis.numItems = this.formItems.value.length;\r\n\t\t}"},"comment":{"url":"https://api.github.com/repos/triniwiz/nativescript-pager/issues/comments/393159489","html_url":"https://github.com/triniwiz/nativescript-pager/issues/67#issuecomment-393159489","issue_url":"https://api.github.com/repos/triniwiz/nativescript-pager/issues/67","id":393159489,"user":{"login":"HoangJK","id":12653469,"avatar_url":"https://avatars2.githubusercontent.com/u/12653469?v=4","gravatar_id":"","url":"https://api.github.com/users/HoangJK","html_url":"https://github.com/HoangJK","followers_url":"https://api.github.com/users/HoangJK/followers","following_url":"https://api.github.com/users/HoangJK/following{/other_user}","gists_url":"https://api.github.com/users/HoangJK/gists{/gist_id}","starred_url":"https://api.github.com/users/HoangJK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoangJK/subscriptions","organizations_url":"https://api.github.com/users/HoangJK/orgs","repos_url":"https://api.github.com/users/HoangJK/repos","events_url":"https://api.github.com/users/HoangJK/events{/privacy}","received_events_url":"https://api.github.com/users/HoangJK/received_events","type":"User","site_admin":false},"created_at":"2018-05-30T13:22:33Z","updated_at":"2018-05-30T13:22:33Z","author_association":"NONE","body":"I have items = [1, 2, 3], Pager show 3 page, it ok.\r\nI use items.unshift(0); this.pager.nativeElement.refresh(true) ;\r\n\r\nconsole.log(items) => [0, 1, 2, 3]\r\n\r\nBut Pager show data: 0 - 1 - 3 - 3"}}
{"actor":{"display_login":"HoangJK"}}