Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70439

The Movie Database

$
0
0

@nature225 wrote:

Hey all,

i have one Problem. I want to get Movie Information from The Movie Database Api

with this provider I want to get Data:

  getData() {
    return new Promise(resolve => {
      this.http.get('https://api.themoviedb.org/3/movie/550?api_key=KEY')
        .subscribe(data => {
          resolve(data);
        }, err => {
          console.log(err);
        });
    });
  }

in my home.ts the code looks like:

  ionViewDidLoad() {
    this.smdData.getData()
      .then((response) => {
        if (response) {
          this.movieData = response;
          console.log(response);
        }
      });
  }
this.movieData  = any;

So if I want to loop in home.html with ngFor I get this Error:

Cannot find a differ supporting object ‘[object Object]’ of type ‘object’. NgFor only supports binding to Iterables such as Arrays.

Okay that means ngFor can only work with Arrays, but how can I do my JSON Data from API to Array? Please Help

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70439

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>