title: Angular 4 ng-selected not working
body: <p>I cannot get <code>ng-selected</code> to work. I first tried just adding <code>selected</code> in the option tag, but after reading it seems like I need to use <code>ng-select</code>. I've tried doing <code>ng-selected="true"</code> and <code>ng-selected="selected"</code> with no luck. I've tried doing the recommended fixes from other stackeoverflow questions but none seem to work for me. At one point (in another html form bc I am having this same problem) it seemed to work, but now it magically stopped.</p>
  
  <pre><code>&lt;div class="col-lg-6"&gt;
    &lt;div class="panel panel-default"&gt;
      &lt;div class="panel-heading"&gt;Caloric Intake Recommendation&lt;/div&gt;
      &lt;div class="panel-body"&gt;
        &lt;form [formGroup]="myForm" (ngSubmit)="onSubmit()"&gt;
          &lt;div class="form-group row"&gt;
            &lt;label for="weight" class="col-lg-2 col-form-label"&gt;Weight&lt;/label&gt;
            &lt;div class="col-lg-10"&gt;
              &lt;input
                  type="number"
                  class="form-control"
                  id="weight"
                  formControlName="weight"
                  placeholder="Weight"&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="form-group row"&gt;
            &lt;label for="goal" class="col-lg-2 col-form-label"&gt;Goal&lt;/label&gt;
            &lt;div class="col-lg-10"&gt;
              &lt;select class="form-control" formControlName="goal" id="goal"&gt;
                &lt;option ng-selected="selected"&gt;Lose Weight&lt;/option&gt;
                &lt;option&gt;Maintain Weight&lt;/option&gt;
                &lt;option&gt;Gain Mass&lt;/option&gt;
              &lt;/select&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;button
              class="btn btn-primary"
              type="submit"
              [disabled]="!myForm.valid"&gt;Submit
          &lt;/button&gt;
          &lt;hr&gt;
          &lt;div class="col-sm-4"&gt;
            &lt;label class="col-sm-2 col-form-label"&gt;Your Recommended Protein:&lt;/label&gt;
            &lt;input type="text" value={{this.protein}}&gt;
          &lt;/div&gt;
          &lt;div class="col-sm-4"&gt;
            &lt;label class="col-sm-2 col-form-label"&gt;Your Recommended Carbs:&lt;/label&gt;
            &lt;input type="text" value={{this.carbs}}&gt;
          &lt;/div&gt;
          &lt;div class="col-sm-4"&gt;
            &lt;label class="col-sm-2 col-form-label"&gt;Your Recommended Fats:&lt;/label&gt;
            &lt;input type="text" value={{this.fat}}&gt;
          &lt;/div&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <blockquote>
    <p>Component</p>
  </blockquote>
  
  <pre><code>import {Component} from "@angular/core";
  import {FormControl, FormGroup, Validators} from "@angular/forms";
  import {CaloricIntakeClass} from "./caloric-intake.class";
  
  @Component({
    selector: 'app-caloric-intake',
    templateUrl: './caloric-intake.component.html',
    styleUrls: ['./caloric-intake.component.css']
  })
  export class CaloricIntakeComponent{
    myForm: FormGroup;
    caloricIntake: CaloricIntakeClass;
    weight: number;
    goal: string;
    protein: number;
    carbs: number;
    fat: number;
  
  
    onSubmit() {
      this.weight = this.myForm.value.weight;
      this.goal = this.myForm.value.goal;
      this.myForm.reset();
  
      this.caloricIntake = new CaloricIntakeClass(this.weight);
      if (this.goal === 'Cutting'){
            this.caloricIntake.cuttingIntake();
      } else if (this.goal === 'Bulking'){
            this.caloricIntake.bulkingIntake();
      } else {
            this.caloricIntake.maintaingIntake();
      }
      this.protein = this.caloricIntake.getProtein();
      this.carbs = this.caloricIntake.getCarbs();
      this.fat = this.caloricIntake.getFat();
    }
  
    ngOnInit() {
      this.myForm = new FormGroup({
        weight: new FormControl(null, Validators.required),
        goal: new FormControl(null, Validators.required)
      });
    }
  }
  </code></pre>