title: Angular 12 - Select dropdown option based on the value in template
body: <p>I am working on a POC in which i am facing a challenge. Please help me solving it.</p>
  <p><strong>Situation</strong></p>
  <ol>
  <li>I have list of categories which needs to be displayed in a select dropdown</li>
  <li>I have a portal object which contains one of the categories in the select dropdown</li>
  </ol>
  <p><strong>Challenge:</strong> I need to select the option which matches the category of the portal while populating the select dropdown</p>
  <p>Category select dropdown population and prtl-category binding is,</p>
  <pre><code>&lt;!-- Portal Category --&gt;
      &lt;div class=&quot;row prtl_field_margin&quot;&gt;
          &lt;div class=&quot;col-4 prtl_form_field_right&quot;&gt;
              &lt;label for=&quot;pCategory&quot; class=&quot;control-label prtl_form_label&quot;&gt;Category&lt;/label&gt;
          &lt;/div&gt;
          &lt;div class=&quot;col-4&quot;&gt;
              &lt;select class=&quot;form-control&quot; id=&quot;pCategory&quot; name=&quot;pCategory&quot; [(ngModel)]=&quot;prtl.category&quot;&gt;
                  &lt;option value=&quot;&quot; disabled&gt;Choose a Category&lt;/option&gt;
                  &lt;option *ngFor=&quot;let c of categories&quot; [ngValue]=&quot;c&quot;&gt;{{ c.name }}&lt;/option&gt;
              &lt;/select&gt;
          &lt;/div&gt;
          &lt;div class=&quot;col-4&quot;&gt;&lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  <p>prtl object data in component ts file is,</p>
  <pre><code>{
    &quot;name&quot;: &quot;Stock Market&quot;,
    &quot;id&quot;: 10,
    &quot;category&quot;: {
      &quot;id&quot;: &quot;1&quot;,
      &quot;name&quot;: &quot;Cricket&quot;
    }
  }
  </code></pre>
  <p>Category array data in component ts file is,</p>
  <pre><code>[
    {
      &quot;id&quot;: &quot;1&quot;,
      &quot;name&quot;: &quot;Cricket&quot;
    },
    {
      &quot;id&quot;: &quot;2&quot;,
      &quot;name&quot;: &quot;Football&quot;
    }
  ]
  </code></pre>
  <p><strong>Result needed:</strong> Categories dropdown should contain all the categories in the array. However, the category which matches to the category of prtl object should be selected. As in, the cricket category should be selected after dropdown is populated, but the user is free to change it to football.</p>