title: Angular JS Directive scope.$watch into Angular 6
body: <pre><code>    In angular 1, The code was written like this.
  
  
  **AngularJS**:
  
      scope.$watch('hiddenScroll', () =&gt; {
                $timeout(this.updateFadersVisibility());
              });
  
  
  
      **Angular 6**
  
      ngOnChanges(changes: any) {
        setTimeout(() =&gt; {
            this.updateFadersVisibility();
          }, 1000);
        }
  </code></pre>
  
  <p>I am looking for a better solution. ngOnChanges are not working as expected. </p>