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.

Expression X has changed after it was checked. Previous value...

See original GitHub issue

Hi. As in readme, I’ve installed angular2-moment. It works perfect. The problem I’m having is, that I’m using the pipe in @Component:

<ion-card class="single-tweet">

  <ion-item>
    <ion-avatar item-left>
      <img src="{{tweet.user.profile_image_url_https}}">
    </ion-avatar>
    <ion-note item-right class="time">
      {{tweet.unixtime | amTimeAgo}}
    </ion-note>
    <div class="name">{{tweet.user.name}}</div>
    <small class="screen-name">@{{tweet.user.screen_name}}</small>
  </ion-item>

</ion-card>

I use this component on ListAll page. When clicking single ion-card, I’m jumping to details page, where I’m again using component above. If, in the meantime I update my tweet variable, I’ll then get this error:

browser_adapter.js:76 EXCEPTION: Expression '
      {{tweet.unixtime | amTimeAgo}}
     in SingleTweet@7:38' has changed after it was checked. Previous value: '39 minutes ago'. Current value: '40 minutes ago' in [
      {{tweet.unixtime | amTimeAgo}}
     in SingleTweet@7:38]

and then:

TypeError: Cannot read property 'removeEventListener' of undefined
    at Content.ngOnDestroy (content.js:79)
    at AbstractChangeDetector.ChangeDetector_DetailPage_0.dehydrateDirectives (viewFactory_DetailPage:81)
    at AbstractChangeDetector.dehydrate (abstract_change_detector.js:141)
    at AbstractChangeDetector.destroyRecursive (abstract_change_detector.js:158)
    at AbstractChangeDetector.destroyRecursive (abstract_change_detector.js:165)
    at AppView.destroy (view.js:111)
    at AppViewManager_.destroyViewInContainer (view_manager.js:124)
    at ViewContainerRef_.remove (view_container_ref.js:116)
    at Array.<anonymous> (nav-controller.js:1108)
    at ViewController.destroy (view-controller.js:420)

Should I in between somehow disable timeago when I do the update? Any help would be perfect 👍

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
urishcommented, Feb 21, 2016

@lordgreg are you using typings in your project?

try typings install --save moment

0reactions
jvelocommented, Jun 10, 2016

@urish still happens, on 0.8.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

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...
I was having trouble with . ERROR: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value ...
Read more >
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 >
Fixing "Expression has changed after it was checked" in Angular
The exception appears (in the development mode) at the moment the value is checked and value is different of the updated value. Error...
Read more >
Detect Changes in Data and Expression Values - MathWorks
Edge detection operators behave in a similar way, except that they compare the value of an expression at the beginning of the last...
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