Ng2-select: Error: No value accessor for form control with unspecified name attribute

Created on 7 Sep 2017  Â·  12Comments  Â·  Source: valor-software/ng2-select

i checked the demo code, and used this componnet in my app (based on ng2-admin) but ijm getting this trace `core.es5.js:1084 ERROR Error: Uncaught (in promise): Error: No value accessor for form control with unspecified name attribute
Error: No value accessor for form control with unspecified name attribute
at _throwError (forms.es5.js:1918)
at setUpControl (forms.es5.js:1828)
at NgModel._setUpStandalone (forms.es5.js:4402)
at NgModel._setUpControl (forms.es5.js:4388)
at NgModel.ngOnChanges (forms.es5.js:4319)
at checkAndUpdateDirectiveInline (core.es5.js:10812)
at checkAndUpdateNodeInline (core.es5.js:12238)
at checkAndUpdateNode (core.es5.js:12177)
at prodCheckAndUpdateNode (core.es5.js:12704)
at Object.View_UserStatisticsComponent_0.co [as updateDirectives] (UserStatisticsComponent.ngfactory.js:296)
at _throwError (forms.es5.js:1918)
at setUpControl (forms.es5.js:1828)
at NgModel._setUpStandalone (forms.es5.js:4402)
at NgModel._setUpControl (forms.es5.js:4388)
at NgModel.ngOnChanges (forms.es5.js:4319)
at checkAndUpdateDirectiveInline (core.es5.js:10812)
at checkAndUpdateNodeInline (core.es5.js:12238)
at checkAndUpdateNode (core.es5.js:12177)
at prodCheckAndUpdateNode (core.es5.js:12704)
at Object.View_UserStatisticsComponent_0.co [as updateDirectives] (UserStatisticsComponent.ngfactory.js:296)
at resolvePromise (zone.js:769)
at resolvePromise (zone.js:740)
at zone.js:817
at ZoneDelegate.webpackJsonp.1056.ZoneDelegate.invokeTask (zone.js:424)
at Object.onInvokeTask (core.es5.js:4140)
at ZoneDelegate.webpackJsonp.1056.ZoneDelegate.invokeTask (zone.js:423)
at Zone.webpackJsonp.1056.Zone.runTask (zone.js:191)
at drainMicroTaskQueue (zone.js:584)
at HTMLAnchorElement.ZoneTask.invoke (zone.js:490)


​`

Most helpful comment

For me it ended up being a missing material module, for me it was the MatSelectModule, check that you have the required material modules, i.e. MatInputModule, MatRadioModule, etc..

All 12 comments

Any luck with this?

Hey. Got any solution for that ?

For me it ended up being a missing material module, for me it was the MatSelectModule, check that you have the required material modules, i.e. MatInputModule, MatRadioModule, etc..

ng2-select - does not accept ngModel

@sks40gb @rkritika @DanielOrmeno
Add in your app.module.ts these imports.

import { NativeScriptModule } from "nativescript-angular/nativescript.module";
import { NativeScriptFormsModule } from "nativescript-angular/forms";

;)

same issue for me
Resolution would be just removed undeclared [(ngModel)] from HTML
or create variable

HI! The component has continued developing in the fork: https://github.com/optimistex/ngx-select-ex
Check the demo: https://optimistex.github.io/ngx-select-ex/
It has a lot of fixed issues. I think the issue solved too.

Thank you @krishnpalchouhan
I solve same issue with @krishnpalchouhan 's answer.

  1. Remove all [(ngModel)] from HTML and binding variable from JS
  2. create variable in JS
  3. create [(ngModel)] in HTML

I have the same issue and the error was cause by unconsciously setting ngModel in <div>. Check if you set the ngModel on the <input>?

I had the exact same issue. This worked for me. Import the module in your (your module here).module.ts . You have to import npm modules in the module.ts file where the component is using it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

newerik picture newerik  Â·  5Comments

Cadenei picture Cadenei  Â·  4Comments

fdu-axiometrics picture fdu-axiometrics  Â·  5Comments

BenDevelopment picture BenDevelopment  Â·  5Comments

Hasnain-Bukhari picture Hasnain-Bukhari  Â·  3Comments