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

ExpressionChangedAfterItHasBeenCheckedError #12

Open
abrahamq opened this issue Jul 20, 2017 · 0 comments
Open

ExpressionChangedAfterItHasBeenCheckedError #12

abrahamq opened this issue Jul 20, 2017 · 0 comments
Assignees

Comments

@abrahamq
Copy link
Member

This is happening because moment is getting brought in through a global script tag, which means the DOM needs to be ready before we try to use moment, esp. during tests.

So we set the variables to be '', then quickly change them to the moment().format() string after the DOM is loaded. Angular doesn't like this.

timeline.component.html:5 ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: ''. Current value: 'January 14th 2017, 12:00:00 am'.
at viewDebugError (errors.ts:30)
at expressionChangedAfterItHasBeenCheckedError (errors.ts:29)
at checkBindingNoChanges (util.ts:145)
at checkNoChangesNodeInline (view.ts:477)
at checkNoChangesNode (view.ts:568)
at debugCheckNoChangesNode (services.ts:557)
at debugCheckRenderNodeFn (services.ts:500)
at Object.eval [as updateRenderer] (timeline.component.html:5)
at Object.debugUpdateRenderer [as updateRenderer] (services.ts:477)
at checkNoChangesView (view.ts:383)

@abrahamq abrahamq self-assigned this Jul 20, 2017
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

1 participant