title: Ternary operator within [ngValue]; dynamically deselecting select value
body: <p>I have a situation where I'd like to clear the value from a select input on a form (reactive) if a user changes their selection from another dropdown (this also hides the select input in question.  Ideally I would like to be able to do this inline in the template, rather than add code to the controller.  A thought I had was to try using a ternary operator on the [ngValue] that binds my options.  </p>
  
  <p>Code for context:</p>
  
  <pre><code>&lt;form [formGroup]="myForm"&gt;
  &lt;div&gt;
      &lt;label for="constrainingDropdown"&gt;Constraining Dropdown&lt;/label&gt;
      &lt;div&gt;
          &lt;select name="constrainingDropdown" formControlName="constrainingDropdown"&gt;
              &lt;option disabled value=""&gt;Select an Option&lt;/option&gt;
              &lt;option *ngFor="let opt of constraints" [ngValue]="opt.code"&gt;{{opt.value}}&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;div [hidden]="myForm.controls.constrainingDropdown.value !== 'OPT1'"&gt;
         &lt;div&gt; 
              &lt;select name="constrainingDropdown" formControlName="myDropdown"&gt;
                  &lt;option disabled value=""&gt;Select an Option&lt;/option&gt;
     RELEVANT ==&gt; &lt;option *ngFor="let myOpt of options" [ngValue]="{myForm.controls.constrainingDropdown.value !== 'OPT1' ? '' : myOpt.code}"&gt;{{myOpt.value}}&lt;/option&gt;
              &lt;/select&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is causing some sort of template parse errors: is a ternary operator possible to use in ngValue?  Or will I need another solution?  Again, prefer to not write code in controller for this simple logic. </p>
  
  <p>Current method: subscribing to form change event</p>
  
  <pre><code>this.myForm.controls['constrainingDropdown'].valueChanges.subscribe (
      (opt: string) =&gt; {
          if(opt === 'OPT1') {
             this.myForm.controls.myDropdown.patchValue('');
          }
      }
  )
  </code></pre>