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

Directive not working when the form is inited by the first time #52

Open
2 of 9 tasks
guilhermejcgois opened this issue Feb 1, 2018 · 3 comments
Open
2 of 9 tasks

Comments

@guilhermejcgois
Copy link

This is a...

  • feature request
  • bug report
  • usage question

What toolchain are you using for transpilation/bundling?

  • @angular/cli
  • Custom @ngTools/webpack
  • Raw ngc
  • SystemJS
  • Rollup
  • Other

Environment

NodeJS Version: 6.9.2
Typescript Version: 2.4.2
Angular Version: 4.4.6
@angular-redux/store version: 6.6.0
@angular/cli version: (if applicable) 1.6.3
OS: Win 10

Link to repo showing the issus

(optional, but helps a lot)

Expected Behaviour:

That directive work as expected at first time that the form is built and state on store reflect the form.

Actual Behaviour:

The state doesn't update when a form change occurss, also, no action is fired

Stack Trace/Error Message:

No stack trace

Additional Notes:

Again, the directive only works when I open my form by the secont time

@smithad15
Copy link
Member

Not sure how to help with this. Can you supply more details? A repo I can look at? How have you hooked everything up?

Also, what do you mean by "open my form the second time"? Do you create and destroy it using ngIf? Are you navigating to a page and then away and then back again?

@guilhermejcgois
Copy link
Author

Of course I can, sorry for the poor info. 😖
I can't share the repo here, but the reactive form is inside a modal trigred by route (if is important, isn't the primary router-outlet). The steps are these:

  • user log in the application
  • user navigate to the specific route (e.g. /app/(dashboard/form))
    • at this point, after the form show up to the user (we have a ngif within too), the store isn't update with the default form state, and when a valueChanges is fired, no action is triggered too
  • navigate out from the route, like /app/(dashboard) 'closing' the modal with the form
  • open again the modal with the form
    • the store state was updated as expected, and all changes triggers the action

The reactive form is build on ngOnInit of the modal component, the variable used in the ngIf is set to true asynchronously...

@smithad15
Copy link
Member

Sounds decently complicated enough that I probably won't get the reproduction quite correct. Is it possible for you to create a toy repo showing the issue?

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

No branches or pull requests

2 participants