title: Radio button not selected by default in angular 4
body: <p>I am trying to make the radio button selected by default in angular 4. </p>
  
  <p>Below is my template code:</p>
  
  <pre><code> &lt;div class="form-check form-check-inline"&gt;
    &lt;label class="form-check-label"&gt;  &lt;/label&gt;
      &lt;input type="radio" class="form-check-input"
      name="type"
      [(ngModel)]="searchForm.type"
      [value]="['all']"
  [checked]='searchForm.type ==='all''
      &gt; All
  &lt;/div&gt;
  </code></pre>
  
  <p>And I am initializing default value in my component ngOnInit </p>
  
  <pre><code>export class myComponent{
  searchForm:FormVO = new FormVO();
  
  ngOnInit(){
  this.searchForm.type='all';
  }
  }
  </code></pre>
  
  <p>I also tried with constructor initialize, here actually value is setting to searchForm.type as all in both constructor or nginit way. 
  Issue I am facing is I could not make the radio selected only in template.</p>
  
  <p>These are the ways I tried:</p>
  
  <p>Way 1:</p>
  
  <pre><code>[checked]="searchForm.type ==='all'"
  </code></pre>
  
  <p>Way 2:</p>
  
  <pre><code>[checked]="searchForm.type ==='all' ? true : false"
  </code></pre>
  
  <p>way 3:</p>
  
  <pre><code>[checked]="searchForm.type =='all'"
  </code></pre>
  
  <p>I also read in few sits like through numbers i can make this selected by default. I did not try that way, because I want the solution with string values only.</p>
  
  <p>Thanks in advance. </p>
  
  <p>I request to avoid marking this as duplicate question, as I already tried all the solutions for those questions and nothing worked.</p>
  
  <p>I am using angular cli with angular 4.</p>