title: How to bind dynamic values to the dropdown using ionic 2 & Angular
body: <p><a href="https://i.stack.imgur.com/EuxI5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EuxI5.png" alt="enter image description here"></a>Hi im just trying to bind the  dynamic values to the dropdown but i confused how to bind it .</p>
  
  <p>here is my json data </p>
  
  <pre><code>    [
    {
      "Name": "data1",  
      "sno": 3
  
    },
    {
      "Name": "data2",  
      "sno": 4
    },
    {
      "Name": "data3",  
      "sno": 5
    }
  </code></pre>
  
  <p>here im calling my dynamic data using providers </p>
  
  <pre><code>dropDown(){
  var url1 ='http://xxxxx.xxxx.xxxx.xxx/info/Service1.svc/getData';
  return this.http.get(url1).map(result=&gt;{
    return result.json();
  })
  </code></pre>
  
  <p>after that im calling this in a page by calling it in the constructor and  then using ngOnIt im initializing it </p>
  
  <pre><code>selectedValue: number;
    optionsList: Array&lt;{ value: number, text: string}&gt; = [];
  </code></pre>
  
  <p>the after declaring in the constructor</p>
  
  <pre><code>`ngOnInit(){
  
  
  
      this.optionsList = this.serv.dropDown().subscribe( response =&gt;{
  
        console.log(response.json());
  
      });
  
    }`
  
  
   &lt;ion-select&gt;
      &lt;ion-option *ngFor="let item of optionsList" value="{{item.value}}"&gt;{{item.text}}&lt;/ion-option&gt;
    &lt;/ion-select&gt;
  </code></pre>
  
  <p>but im getting error as <strong>subscription is not assignable to the type</strong> and how to get the selected value and text?</p>