Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

fix(cb-component-comm): check for isFirstChange #3073

Merged
merged 2 commits into from
Jan 5, 2017

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Jan 4, 2017

We weren't checking changedProp.isFirstChange() so for the very first round of change detection, changedProp.previousValue was a private object belonging to Angular. In 4.x this private object changes to undefined.

Since the object itself is private and shouldn't be used, it's more sensible to change the behaviour of the example and test.

/cc @wardbell

log.push( `${propName} changed from ${from} to ${to}`);
let to = JSON.stringify(changedProp.currentValue);
if (changedProp.isFirstChange()) {
log.push(`${propName} changed to ${to}`);
Copy link
Contributor

@wardbell wardbell Jan 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the first logged message to

log.push(`Initial value of ${propName} set to ${to}`);

and update the image. Otherwise, LGTM

@filipesilva filipesilva merged commit aff39d2 into angular:master Jan 5, 2017
@filipesilva filipesilva deleted the fix-component-comm-example branch January 5, 2017 12:08
abdel-ships-it pushed a commit to abdel-ships-it/angular.io that referenced this pull request Feb 11, 2017
* fix(cb-component-comm): check for isFirstChange

* update initial message
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants