Skip to content

igorissen/ngx-tmdb-api

Repository files navigation

ngx-tmdb-api

Angular wrapper library for TheMovieDatabase API.

NOTE: Only version 3 of the API is implemented.

Getting started

Installation

$ npm i -E @igorissen/ngx-tmdb-api

Usage

Import NgxTmdbApiModule in your AppModule and configure it with your TheMovieDatabase API key.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgxTmdbApiModule } from '@igorissen/ngx-tmdb-api';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [ AppComponent ],
  imports: [
    BrowserModule,
    NgxTmdbApiModule.forRoot({ apiKey: 'YOUR_API_KEY_HERE' })
  ],
  bootstrap: [ AppComponent ]
})
export class AppModule {}

Please refer to TheMovieDatabase API documentation for path and query parameters name.

import { Component, OnInit } from '@angular/core';
import { Movies } from '@igorissen/ngx-tmdb-api';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.less']
})
export class AppComponent implements OnInit {
  public ngOnInit(): void {
    Movies.getDetails({
      pathParams: { movie_id: '384018' },
      queryParams: { language: 'FR', append_to_response: 'videos,images' }
    }).subscribe(console.log);
  }
}

Available Resources

v3

About

Angular library which provides functions to make all available requests to TheMovieDatabase API

Resources

Stars

Watchers

Forks

Packages

No packages published