BehaviorSubject problem

I would suggest not using lifecycle events to manage data freshness. There are generally two common situations:

  • the app maintains some sort of overall “selected target” that can be changed in various ways, and this component always wants to reflect the current target.
  • some sort of ID is being passed directly to the component, typically via an @Input binding

In the first situation, I use this idiom. In the second, I use ngOnChanges to indicate when the component should ask whatever service handles this to exchange the ID for a business-layer object.