title: Can an @Input binding be an observable in Angular?
body: <p>I'm creating a component that displays validation errors under input fields. If there is an error message shown, and the user submits the form I want to flash the message to draw their attention.</p>
  
  <p>I was wondering if it's possible to use an observable as an input binding?</p>
  
  <p>That way I can subscribe to the input and flash when any data is observed.</p>
  
  <p>Here's an example of my idea:</p>
  
  <pre><code>@Component({..})
  export class MessageComponent implement OnChanges {
     @Input()
     public flash: Observable&lt;any&gt;;
  
      public ngOnChanges(changes: SimpleChanges): void {
          if ('flash' in changes) {
              (&lt;Observable&lt;any&gt;&gt; changes['flash'].currentValue).subscribe(() =&gt; {
                  // trigger the flash animation here
              });
          }
      }
  }
  </code></pre>
  
  <p>What I can't figure out is if this will leak memory, and how/when should I unsubscribe (or is it even necessary).</p>
  
  <p>Is this kind of practice allowed in Angular?</p>