question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Table] Http example has ExpressionChangedAfterItHasBeenCheckedError

See original GitHub issue

Bug, feature request, or proposal:

When I load this example I obtain an error in my browser, but I intent access to variable that is undefined.

TableHttpExample.html:2 ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'true'.

What are the steps to reproduce?

https://github.com/angular/material2/tree/master/src/material-examples/table-http

What is the use-case or motivation for changing an existing behavior?

Delete this error, but I need use this table and when use with error I can’t render my data

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Dependencies “@angular/animations”: “^4.3.1”, “@angular/cdk”: “github:angular/cdk-builds”, “@angular/common”: “^4.0.0”, “@angular/compiler”: “^4.0.0”, “@angular/core”: “^4.0.0”, “@angular/flex-layout”: “^2.0.0-beta.8”, “@angular/forms”: “^4.0.0”, “@angular/http”: “^4.0.0”, “@angular/material”: “github:angular/material2-builds”, “@angular/platform-browser”: “^4.0.0”, “@angular/platform-browser-dynamic”: “^4.0.0”, “@angular/router”: “^4.0.0”, “core-js”: “^2.4.1”, “hammerjs”: “^2.0.8”, “rxjs”: “^5.1.0”, “zone.js”: “^0.8.4”

Google Chrome: Version 59.0.3071.115 (Official Build) (64-bit)

OS: macOS Sierra 10.12.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
andrewseguincommented, Jul 31, 2017

The issue here was caused by the loading div, not the table. The variables isLoadingResults and isRateLimitReached were initially undefined but changed to false during connect which is no good since it was done during change detection.

Initializing them to false fixes the issue. See this plunker for a working example: https://plnkr.co/edit/pSQHjWgs5uYRMVIKk2J9?p=preview

1reaction
bfwgcommented, Dec 18, 2017

Change to [hidden]="!dataSource.isLoadingResults" seems to fix the issue. Reference: https://github.com/angular/angular/issues/17572

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Debugging "Expression has changed": Explanation ...
Learn a complete explanation about ExpressionChangedAfterItHasBeenCheckedError: why it occurs, how to troubleshoot it and how to fix it.
Read more >
ExpressionChangedAfterItHasBe...
The ExpressionChangedAfterItHasBeenCheckedError error is thrown up when the binding expression changes after being checked by Angular during the ...
Read more >
Stack Overflow
I have a Angular 9, with Ivy on, component with more than one mat-table. One table has rows with input fields bound to...
Read more >
NG0100: Expression has changed after it was checked - Angular
Angular throws an ExpressionChangedAfterItHasBeenCheckedError when an expression value has been changed after change detection has completed.
Read more >
ExpressionChangedAfterItHasBe...
The expression has changed after it was checked (Expressionchangedafterithasbeencheckederror) is one of the common errors, that we encounter ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found