qontu / ngx-inline-editor

Native UI Inline-editor Angular (4.0+) component
https://qontu.github.io/ngx-inline-editor
MIT License
164 stars 90 forks source link

Support for reactive forms #34

Open robgha01 opened 7 years ago

robgha01 commented 7 years ago

I noticed the use of ngModel what about reactive forms ? is this someting that is planned or already supported ?

Importing the ngModel form module is not someting i would want to do.

To make this possible we would need two templates one that already exists and uses ngModel and a second one that use [value]="value" (input)="value = $event.target.value" instead of ngModel, maybe a second component called someting like "ReactiveInlineEditorComponent" that extends InlineEditorComponent but has diffrent template ?

Here is an example of how it could look like modified the source: some minor changes i replaced ' with " you can revert that if you dont like it the other one is using templateUrl instead of template as we need more then one template and it would be to much info in one file if we would use a second variable for it.

ng2-inline-editor.zip

tonivj5 commented 7 years ago

Hi @robgha01, thanks for your feedback, but are you referring to this reactive forms? I don't see any of this in your zip.

I don't know at this moment how to implement that, however I have seen this plnkr and it could be the way (it's possible that we need to create a new component how you say).

Importing the ngModel form module is not someting i would want to do.

Why not?

👍

ahmedtaaw commented 7 years ago

Hello @xxxtonixxx you will find it used in reactive form under ngx-inline-editor branch https://github.com/ahmedtaaw/angular-reactive-form-control-dynamic-ngfor-json