primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Editor issue w/ bet9 + RC3 - No value accessor for ''

Open gatapia opened this issue 10 years ago • 7 comments

After upgrading to beta9 / RC3 the editor component no longer works. The[(ngModel)]="text" throws the error No value accessor for ''.

I am not using a form so I dont think I should be using the new forms stuff / formControlName. However, I could be wrong.

I am basically copying the demo: http://www.primefaces.org/primeng/#/editor and no luck.

gatapia avatar Jun 30 '16 04:06 gatapia

+1 for this issue on MultiSelect in a data table like http://www.primefaces.org/primeng/#/datatablecoltoggler.

hibes avatar Jun 30 '16 06:06 hibes

For me it turned out I had some components still pulling from @angular/common instead of @angular/forms for NG_VALUE_ACCESSOR, ControlValueAccessor. Changed it to this and solved the No value accessor for '' error.

import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';

digitalcraftco avatar Jun 30 '16 21:06 digitalcraftco

In Angular2 rc3 replace from '@angular/forms'; to from '@angular/forms/index';

Example import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms'; change it to import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms/index';

monoflash avatar Jul 01 '16 03:07 monoflash

I just ended up upgrading my whole app to the new forms. Pain in the butt but this document really helps: https://docs.google.com/document/u/1/d/1RIezQqE4aEhBRmArIAS1mRIZtWFf6JxN_7B4meyWK0Y/pub

gatapia avatar Jul 01 '16 03:07 gatapia

@monoflash thx this was it. In my case changed this in togglebutton.js directly in the node_modules folder of primeng and it worked. So it looks like it requires just some small fixes for rc3 in the components for this issue.

spali avatar Jul 01 '16 13:07 spali

@gatapia I use Rc4 and I have same problem with http://www.primefaces.org/primeng/#/autocomplete .

demo.html file

<p-autoComplete  [suggestions]="filteredKnw" (completeMethod)="filterKnw($event)" [minLength]="1"
                      [multiple]="true" [(ngModel)]="tags" #tags="ngModel">
    </p-autoComplete>

in demo.ts file I decalre tags variable : tags:any[];

I don't understand why this bug happen .

ducduongtmb avatar Jul 21 '16 11:07 ducduongtmb

Please try with the latest PrimeNG version and comment if the issue still persists.

Mrtcndkn avatar May 04 '17 11:05 Mrtcndkn