Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Late creation of slides, e.g., after receiving the response of a HTTP request #3

Closed
heese opened this issue Jan 4, 2017 · 1 comment

Comments

@heese
Copy link

heese commented Jan 4, 2017

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:

  • 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!

@heese
Copy link
Author

heese commented May 30, 2017

Works for me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants