title: Storing Api respond inside a variable Ionic
body: <p>I want to store the respond for my call in variable then use it in my code but if I look at the console I get undefined </p>
  
  <pre><code>      getdata(){
  
            return this.http.get&lt;any&gt;('url', { headers: header })    
    }
  
      this.testProvider.getdata().subscribe(data =&gt; 
        {this.films=data.name
  console.log(this.films);
      })
  </code></pre>