You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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'.
What I did:
I created a method manualInit() in SlidesComponent and moved the code from ngAfterViewInit to this new method.
In AppComponent I implemented ngAfterViewChecked and checked if the slides view has children. If yes, then I call manualInit().
However, 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.
Since 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.
I 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
Please let me know if you are unable to work on it till next Wednesday -- I need to finish my app very soon.
Thank you!
The text was updated successfully, but these errors were encountered:
This issue continues the discussion started at JoshDSommer/nativescript-slides#37 (comment)
@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'.
What I did:
manualInit()
inSlidesComponent
and moved the code fromngAfterViewInit
to this new method.AppComponent
I implementedngAfterViewChecked
and checked if the slides view has children. If yes, then I callmanualInit()
.However, this implementation is not very nice. I can imagine that
SlidesComponent
implementsngAfterViewChecked
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 thenSlidesComponent
initialises its internal data structures.Since 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.
I attach the files contained in the folder
slides/app
of your project (except for the folderApp_Resources
) so you can have a look and give it a go: app.zipPlease let me know if you are unable to work on it till next Wednesday -- I need to finish my app very soon.
Thank you!
The text was updated successfully, but these errors were encountered: