Conversation
b8d17bf to
d587380
Compare
Add control[formControlName] selectors to value accessor directives.
|
Was this in the 2.5 release? |
|
@ScottMGerstl I just tried this using NS 2.5 and it appears to work. Thank you @hdeshev and @clarenceh! |
|
Hello ! I have been unsuccessfully trying for 2 days to implement reactive form in Nativescript. I have just written a simple component : with a simple template : -> I have the error "Error: No value accessor for form control with unspecified name attribute" if I change the textfield row to add ngDefaultControl : it works BUT there is no synchronisation, if I fill the form on app, {{ name.value }} still displays null Did I miss something ?? Do you have some working code ? Thanks ! |
|
Hi serge, I have successfully implemented. I can share some code with you this weekend. Regards, |
|
@sd-lab I use a formGroup around the TextField with formControlName rather than [formControl]. Here is a gist of an entire login form: https://gist.github.com/kinggolf/e48c6c8f72d570922bf3606b14bf08b4 I found this video to be very helpful: https://www.youtube.com/watch?v=xYv9lsrV0s4 Good luck. |
|
Thank you both for your fasts answers ! I have allready try this code: with this template: but have got this error: it works perfectly fine with the same code on angular without native script. @ScottMGerstl: still interested by your code ! serge |
|
@sd-lab What version of NativeScript are you using? |
|
Hi, I restarted from scratch to be sure not to have missed anything ! -> lauch app, everything fine create file app/hero-detail.component.ts with code: change my app.module.ts (add ReactiveFormsModule and HeroDetailComponent) to: and my app.component.ts to: my package.json file look like : still have the error: |
|
Ok, got the answer elsewhere: |
Just adding selectors for Control[formControlName] thanks to @clarenceh's excellent work in #526.