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

Warning message in console with *ngFor #47

Open
NHKK opened this issue Jul 5, 2019 · 2 comments
Open

Warning message in console with *ngFor #47

NHKK opened this issue Jul 5, 2019 · 2 comments

Comments

@NHKK
Copy link

NHKK commented Jul 5, 2019

For my app component i'm doing

//app.component.html
<tabset>
 <tab *ngFor="let i of index" title="i">{{i}}</tab>
</tabset>
//app.component.ts
index = [1,2,3,4];

this is the error i'm seeing in console: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngIf: false'. Current value: 'ngIf: true'

@maximelafarie maximelafarie self-assigned this Aug 13, 2019
@maximelafarie
Copy link
Owner

Hi @NHKK and thank you for reporting us this issue.
I'll try to reproduce it and come back to you after that.
Have a nice day! 🖖

@Tsukim09
Copy link
Collaborator

Hi @NHKK,
You can fix this issues by setting manually the 'active' option.

As exemple :

//app.component.html
<ngx-tabset>
    <ngx-tab *ngFor="let tab of tabArray, let i = index" title="tab" [active]="i === 0">
         {{ tab }}
    </ngx-tab>
</ngx-tabset>

//app.component.ts
tabArray = [1,2,3,4];

Cheers !

@maximelafarie maximelafarie changed the title doesnt work with *ngFor Warning message in console with *ngFor Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants