Primeng: Error appears while using p-checkbox in formArray control

Created on 3 May 2018  路  5Comments  路  Source: primefaces/primeng

If you have a PrimeNG PRO Support subscription please post your issue at;

https://pro.primefaces.org

where our team will respond within 4 business hours.

If you do not have a PrimeNG PRO Support subscription, fill-in the report below. Please note that
your issue will be added to the waiting list of community issues and will be reviewed on a first-come first-serve basis, as a result, the support team is unable to guarantee a specific schedule on when it will be reviewed. Thank you for your understanding.

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
When i try to use p-checkbox in *ngFor loop, an error appears in console:

Error: this.model.indexOf is not a function

and nothing works at all

Expected behavior
If you change code from p-checkbox to simple input or mat-checkbox, everything works fine

Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/angular-primeng-p-checkbox-issue

What is the motivation / use case for changing the behavior?

Please tell us about your environment:
Ubuntu 16.04, Intellij Idea, @angular/cli

  • Angular version: 5.2.8

  • PrimeNG version: 5.2.5

  • Browser: Chrome Version 64.0.3282.167 (Official Build) (64-bit)

Most helpful comment

Binary attribute helps me, stackoverflow

All 5 comments

Angular version: 6.0
PrimeNG version: 5.25 and 6.0 alpha01

I have just tried to embed an primeng check box in my component directive. When i click the check box I get the same message as the issue.

TypeError: this.model.indexOf is not a function

The error occurs on line 64 of the checkbox.js file.

Binary attribute helps me, stackoverflow

Yeah, nice workaround, thank you!

I'm unable to replicate with the latest PrimeNG. If the issue still persists with the new version please create a new issue with our stackblitz template.

primeng checkbox is really buggy. This should be brought up to the standard of other libraries and use formControlName

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gatapia picture gatapia  路  3Comments

lilling picture lilling  路  3Comments

watalberto picture watalberto  路  3Comments

jisqaqov picture jisqaqov  路  3Comments

KannanMuruganmony picture KannanMuruganmony  路  3Comments