{"action":"opened","issue":{"url":"https://api.github.com/repos/TheOriginalJosh/nativescript-ng2-slides/issues/3","repository_url":"https://api.github.com/repos/TheOriginalJosh/nativescript-ng2-slides","labels_url":"https://api.github.com/repos/TheOriginalJosh/nativescript-ng2-slides/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/TheOriginalJosh/nativescript-ng2-slides/issues/3/comments","events_url":"https://api.github.com/repos/TheOriginalJosh/nativescript-ng2-slides/issues/3/events","html_url":"https://github.com/TheOriginalJosh/nativescript-ng2-slides/issues/3","id":198661638,"number":3,"title":"Late creation of slides, e.g., after receiving the response of a HTTP request","user":{"login":"heese","id":5026525,"avatar_url":"https://avatars.githubusercontent.com/u/5026525?v=3","gravatar_id":"","url":"https://api.github.com/users/heese","html_url":"https://github.com/heese","followers_url":"https://api.github.com/users/heese/followers","following_url":"https://api.github.com/users/heese/following{/other_user}","gists_url":"https://api.github.com/users/heese/gists{/gist_id}","starred_url":"https://api.github.com/users/heese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heese/subscriptions","organizations_url":"https://api.github.com/users/heese/orgs","repos_url":"https://api.github.com/users/heese/repos","events_url":"https://api.github.com/users/heese/events{/privacy}","received_events_url":"https://api.github.com/users/heese/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-04T09:17:39Z","updated_at":"2017-01-04T09:17:39Z","closed_at":null,"body":"This issue continues the discussion started at https://github.com/TheOriginalJosh/nativescript-slides/issues/37#issuecomment-266632873\r\n\r\n@TheOriginalJosh I pulled the current version of nativescript-ng2-slides and played around with it. I have probably found a way to solve the use case 'late creation of slides'.\r\n\r\nWhat I did:\r\n- I created a method `manualInit()` in `SlidesComponent` and moved the code from `ngAfterViewInit` to this new method.\r\n- In `AppComponent` I implemented `ngAfterViewChecked` and checked if the slides view has children. If yes, then I call `manualInit()`.\r\n\r\nHowever, this implementation is not very nice. I can imagine that `SlidesComponent` implements `ngAfterViewChecked` and checks every time it is called if the number of children has changed (= very basic way of detecting new slides). If the number has changed then `SlidesComponent` initialises its internal data structures.\r\n\r\nSince I am not an expert regarding nativescript and angular, and you know your code better than me I would appreciate if you could add this behaviour to your library -- that is if it makes sense to you.\r\n\r\nI attach the files contained in the folder `slides/app` of your project (except for the folder `App_Resources`) so you can have a look and give it a go: [app.zip](https://github.com/TheOriginalJosh/nativescript-ng2-slides/files/684256/app.zip)\r\n\r\nPlease let me know if you are unable to work on it till next Wednesday -- I need to finish my app very soon.\r\n\r\nThank you!"}}
{"actor":{"display_login":"heese"}}