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

Problem subscribe in add FormModel and FormGroup #344

Closed
rodolfocop opened this issue Apr 27, 2017 · 2 comments
Closed

Problem subscribe in add FormModel and FormGroup #344

rodolfocop opened this issue Apr 27, 2017 · 2 comments
Labels

Comments

@rodolfocop
Copy link

Hi, first of all I would like to congratulate you for the component.

I'm having a usage problem in the following situation.

I have a query that returns me Observable, but when I perform the subscribe from that Observable and add it to my formModel and formGroup, my screen goes white as if it were nothing inside.

Ex does not work:

observable.subscribe ((itemObservable) => { this.title = 'Test';  this.formModel = itemObservable;  this.formGroup = this.formService.createFormGroup (itemObservable); });

Ex works:

this.title = 'Test'; This.formModel = itemXpto; This.formGroup = this.formService.createFormGroup (itemXpto);

Has anyone ever experienced this?

@rodolfocop
Copy link
Author

Hi, I solved this problem.

I changed

public formModel: DynamicFormControlModel[] = null;

To
public formModel: Observable<DynamicFormControlModel[]>;

And add this ChangeDetectorRef in my constructor, within my method that is subscribe add markForCheck from ChangeDetectorRef

@udos86
Copy link
Owner

udos86 commented Apr 27, 2017

@rodolfocop Thanks for your kind words and thumbs up for solving your problem!

@udos86 udos86 added the core label Apr 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants