eakoriakin / ionic-selectable

Ionic Selectable is an Ionic versatile and highly customizable component that serves as a replacement to Ionic Select, and allows to search items, including async search, create items, customize the layout with templates and much more. It provides an intuitive API and is easy to set up and use.
MIT License
549 stars 126 forks source link

No value accessor for form control with unspecified name attribute #134

Closed duduulopes closed 5 years ago

duduulopes commented 5 years ago

I'm trying to use simple like that and I have the following error: No value accessor for form control with unspecified name attribute

<ion-content>
    <ion-item text-center transparent>
        <ion-label stacked>INSPECIONADO POR</ion-label>
        <ionic-selectable
                 item-content
                 [(ngModel)]="inspecao.idFuncionarioInspecionado"
                 [items]="funcionarios"
                 itemValueField="id"
                 itemTextField="nome"
                 [canSearch]="true">
        </ionic-selectable>
     </ion-item>
<ion-content>

If I put the attribute name="any-name", the error change to: No value accessor for form control with name 'any-name'

I'm using angular 5 and Ionic 3. `

eakoriakin commented 5 years ago

Hey, your code seems correct. Check out this demo, it might help you.

duduulopes commented 5 years ago

I replied the same code on demo and the error was the same.

This component just work in Angular 6?

eakoriakin commented 5 years ago

Which ionic version do you have?

duduulopes commented 5 years ago
"dependencies": {
    "@agm/core": "^1.0.0-beta.5",
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/core": "~4.15.0",
    "@ionic-native/date-picker": "^4.18.0",
    "@ionic-native/network": "^4.17.0",
    "@ionic-native/splash-screen": "~4.15.0",
    "@ionic-native/status-bar": "~4.15.0",
    "@ionic/storage": "2.2.0",
    "angular2-uuid": "^1.1.1",
    "angularfire2": "^5.0.0-rc.11",
    "cordova-android": "7.0.0",
    "cordova-plugin-datepicker": "^0.9.3",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.2.3",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "firebase": "^5.3.1",
    "ion-affix": "^2.0.0",
    "ionic-angular": "3.9.2",
    "ionic-select-searchable": "^2.10.0",
    "ionicons": "3.0.0",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.1",
    "@ionic/lab": "1.0.13",
    "typescript": "~2.6.2",
    "ws": "^3.3.2"
  }
eakoriakin commented 5 years ago

Ok, I see, you use ionic-select-searchable that might have some issues and is no longer supported. Try to use the latest ionic-selectable@3.2.0.

duduulopes commented 5 years ago

You are right, I'm really really sorry.

When I was trying to fix another issue I changed for ionic-select-searchable to test and forgot to back to ionic-selectable.

Thanks a lot.

eakoriakin commented 5 years ago

No problem mate.