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
filipesilva merged 2 commits intoangular:masterfrom Jan 5, 2017
Merged
fix(cb-component-comm): check for isFirstChange#3073filipesilva merged 2 commits intoangular:masterfrom
filipesilva merged 2 commits intoangular:masterfrom
Conversation
Foxandxss
approved these changes
Jan 4, 2017
wardbell
reviewed
Jan 5, 2017
| log.push( `${propName} changed from ${from} to ${to}`); | ||
| let to = JSON.stringify(changedProp.currentValue); | ||
| if (changedProp.isFirstChange()) { | ||
| log.push(`${propName} changed to ${to}`); |
Contributor
There was a problem hiding this comment.
Please change the first logged message to
log.push(`Initial value of ${propName} set to ${to}`);
and update the image. Otherwise, LGTM
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We weren't checking
changedProp.isFirstChange()so for the very first round of change detection,changedProp.previousValuewas 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