title: Angular - trigger an event based on a variable change
body: <p>I have a list of items that is set in the service and is called in the ngOnInit():</p>
  <pre><code>async ngOnInit(){
     this.items = await this.service.getItems();
  }
  </code></pre>
  <p>and this list is rendered using the directive *ngfor.</p>
  <p>However, now I need to refresh the items list when there is any change in a variable. So I need an event that runs only when a certain variable (lets called it <strong>itemCategories</strong>) changes its value lets.</p>
  <p>How can I achieve this?</p>
  <p>Angular version is 12 and I am new to this</p>