drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.39k stars 1.63k forks source link

Issue with *ngFor in Angular 4 #394

Open diegocurbelo12 opened 6 years ago

diegocurbelo12 commented 6 years ago

Hi All, I think I found an issue when try to use ngFor directive and iCheck

if you try something like:

<div *ngFor="let benefit of benefits">
                    <input type="checkbox" icheck>
                    <label class="check-label"> {{benefit.name}}</label>
</div>

where icheck is an angular directive only to write the jquery code

then the result is the Dom elements <ins class="iCheck-helper" is getting size up to 500 px (or all parent elements) then checkbox not works, only select the last one.

any idea or workaround?

ShivChatur commented 6 years ago

ngFor is not working. Below POC shows, there is indeed a problem with "ngFor" with angular 4.0

If code in case-1 is used then getting result-1, but when actual code (case-2) is used, then screen is empty. case-1:

{{ mytitle }}


case-2:

{{ mytitle }}


result-1: Welcome to app! Movie List Movie one,Movie Two,Movie Three result-2: Blank Screen. Nothing is appearing PFB ts of the ListComponent //list.components.ts file import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-list', templateUrl: './list.component.html', styleUrls: ['./list.component.css'] }) export class ListComponent implements OnInit { items = ['Movie one', 'Movie Two', 'Movie Three']; mytitle: string='Movie List'; constructor() { } ngOnInit() { } }
ShivChatur commented 6 years ago

angular 4.0 *ngFor is not working

even for simple arrays like items : any[] = ['one','two'];

so it wont work for object arrays as well there is some bug