title: cannot set values to ion-input
body: <p>I am creating an ionic application that send from values to server. I want to fill the text filed values from the controller. But though i get values in controller i am not able to show the values in text field.</p>
  
  <p>My HTML area is:</p>
  
  <pre><code>&lt;ion-item&gt;
                &lt;ion-label&gt;&lt;ion-icon name="book"&gt;&lt;/ion-icon&gt;&lt;/ion-label&gt;
                &lt;ion-input [(ngModel)]="collegename" placeholder="College name" type="text" value="{{selectedcollegename}}"&gt;&lt;/ion-input&gt;
              &lt;/ion-item&gt;
  </code></pre>
  
  <p>Angular code:</p>
  
  <pre><code>export class MessagePage {
    name: string; 
    id: string; 
    collegename: string = '';
    description: string = '';
    loading: any;
    selectedcollegename: string='';
    selectedcollegeid: string='';
    constructor(private alertCtrl: AlertController,public navCtrl: NavController, public navParams: NavParams,public apiService: ApiServiceProvider, public authService: Auth,public loadingCtrl: LoadingController) {
      this.name = navParams.get('name');
      this.id = navParams.get('id');
    }
  
    ionViewDidLoad() {
      this.selectedcollegename = this.name;
      this.selectedcollegeid = this.id;
      console.log("selectedcollegename name is "+this.selectedcollegename);
      console.log("selectedcollege id is "+this.selectedcollegeid);
    }
  }
  </code></pre>
  
  <p>Console error:</p>
  
  <p><a href="https://i.stack.imgur.com/AaKwH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AaKwH.png" alt="enter image description here"></a></p>
  
  <p><strong>I UPDATED THE CODE AS</strong>:</p>
  
  <p>changed the </p>
  
  <pre><code>ngOnInit() {
      this.selectedcollegename = this.name;
      this.selectedcollegeid = this.id;
      console.log("selectedcollegename name is "+this.selectedcollegename);
      console.log("selectedcollege id is "+this.selectedcollegeid);
    }
  </code></pre>
  
  <p>Now i didnt get any errors but no values are shown in tex field.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I removed the <strong>[(ngModel)]</strong> now it works.. but i need ngmodel there.. what am i missing??</p>