Skip to content

Instantly share code, notes, and snippets.

@LironHazan
Last active October 7, 2018 06:52
Show Gist options
  • Save LironHazan/9d83f49a2e8c394f9c2e422197bd1b09 to your computer and use it in GitHub Desktop.
Save LironHazan/9d83f49a2e8c394f9c2e422197bd1b09 to your computer and use it in GitHub Desktop.
  • On default changeDetection, every async task will trigger changed detection (as dirty checking - comparing new value to old and decides if to update the view)

  • On onPush the component depends by its @Input() and changeDetection will be triggred when:

  1. Input reference changed (which is awsome cause it forces you to work with immutable objects).
  2. If a componnent custom/dom event is triggred (or its child event).
  3. When explicitly running the detectChanges() of ChangeDetectorRef or by ApplicationRef.tick() which will run change detection upon all application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment