Skip to content

Commit

Permalink
Update assets for lifecycle hooks page (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
genesistms authored and GZGavinZhao committed May 18, 2022
1 parent 829e980 commit 4d2f5b4
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AfterChangesComponent implements AfterChanges {

// #docregion ng-after-changes
ngAfterChanges() {
changeLog.add('Input property has changed.');
changeLog.add('Input property has changed. ($power)');
}
// #enddocregion ng-after-changes

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/_assets/image/ng/devguide/lifecycle-hooks/do-check-anim.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified src/_assets/image/ng/devguide/lifecycle-hooks/peek-a-boo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions src/guide/lifecycle-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,11 @@ The host `AfterChangesParentComponent` binds to them like this:
<after-changes [hero]="hero" [power]="power"></after-changes>
```

<!-- TODO: migrate -->
<!-- Here's the sample in action as the user makes changes. -->
<!-- <img class="image-display" src="{% asset ng/devguide/lifecycle-hooks/on-changes-anim.gif @path %}" alt="AfterChanges"> -->
<!-- The log entry appear as the string value of the *power* property changes. -->
<!-- But the `ngAfterChanges` does not catch changes to `hero.name` -->
<!-- That's surprising at first. -->
Here's the sample in action as the user makes changes.
<img class="image-display" src="{% asset ng/devguide/lifecycle-hooks/after-changes-anim.gif @path %}" alt="AfterChanges">
The log entry appear as the string value of the *power* property changes.
But the `ngAfterChanges` does not catch changes to `hero.name`
That's surprising at first.

Angular only calls the hook when the value of the input property changes.
The value of the `hero` property is the *reference to the hero object*.
Expand Down

0 comments on commit 4d2f5b4

Please sign in to comment.