Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with *ngFor in Angular 4 #394

Open
diegocurbelo12 opened this issue Oct 6, 2017 · 2 comments
Open

Issue with *ngFor in Angular 4 #394

diegocurbelo12 opened this issue Oct 6, 2017 · 2 comments

Comments

@diegocurbelo12
Copy link

diegocurbelo12 commented Oct 6, 2017

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
Copy link

*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 }}


  • {{ items }}

case-2:

{{ mytitle }}


  • {{ item` }}

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants