-
-
Notifications
You must be signed in to change notification settings - Fork 241
NativeScript forms doesn't work in lazy loaded modules #735
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
Comments
Hi @chrillewoodz, |
Ok that really is unfortunate, I hope this gets resolved as quickly as possible. |
@tsonevn Now I have the same problem even without lazy loading.. |
Hi @chrillewoodz, |
Hi @chrillewoodz, The reason that the forms were not working is that the |
@sis0k0 Did you also manage to solve the action bar problem? |
Here is a working example in our sdk-examples of using action bar within lazy loaded module: |
@sis0k0 Thank you so much! Action bar started working automatically once I'd fixed the issues with the module imports. Now we can really get this project going :D |
Its very unclear how to use form* directives at all and i think its good to give details and examples in documentation. |
All of these links appear dead and I now have the same issue, can anyone help me out? |
Hey @rohanrichards, you should import NativeScriptCommonModule into any lazy loaded module. A simple shared.module.ts which would be imported into every lazy loaded module would look like this:
And ActionBar starts working... :) |
A bunch of my
implied that it didn't have to be in each of the lazy loaded modules. This seems to not be the case as adding
to each of the lazy loaded modules fixed things. Anyways, it would help if the docs clarified what's required or how this works. |
I've done A LOT of digging now and it seems like you guys have some problems with lazy loaded modules because NOTHING seems to work in them. FormBuilder works in the
app.component.html/ts
files but as soon as I put the very same code in a lazy loaded module it stops working. The FormBuilder values aren't getting populated despite the values changing inside the text fields.The
ActionBar
is not getting picked up either, can't change title, put a go back button or anything inside a lazy loaded module. I haven't tried more stuff but I'm assuming that they will break as well based on these recent findings.I tried downloading this repo which has a working
FormBuilder
example set up:https://github.com/skywidesoft/ns-formcontrol-demo
It works, BUT, then I tried moving the very same code into a lazy loaded module and it stops working.
I use this to lazy load the module with a string (this is provided in the
app.module.ts
:Here is my example app that uses lazy loading:
https://github.com/andresfleat/native-app/tree/sprint1
Look inside the
+login
module for the code that isn't working, or+register
.Please take a look at this as quick as possible so that me and others with the similar issues can move forward in our development instead of tearing our eyes out, cheers. If you need more info let me know and I'll try to provide it.
The text was updated successfully, but these errors were encountered: