Giter Site home page Giter Site logo

andrewjbateman / angular-movie-database Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 11.0 2.82 MB

:clipboard: Angular app to create movie database using rxjs and observables

License: MIT License

JavaScript 7.36% TypeScript 79.69% HTML 6.08% SCSS 6.87%
database typescript rxjs json movie-database observables json-server typescript4 angular rxjs7

angular-movie-database's Introduction

โšก Angular Movie Database

  • App using Angular to create a movie database. The home screen displays a list of movie images. Each image redirects to a movie detail page with movie details listed using data-binding.
  • Tutorial code from Paul Halliday see ๐Ÿ‘ Inspiration below. Updated to latest Angular version.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

๐Ÿ“„ Table of contents

๐Ÿ“š General info

  • App routing module to load movie home screen. Differential loading used with 2nd routing module.
  • Movie-routing module for: list of movies (MovieListComponent), form to add movie (AddMovieComponent) and a movie detail page (MovieDetailComponent).
  • Dummy backend used to store json movie data.

๐Ÿ“ท Screenshots

Example screenshot. Example screenshot. Example screenshot.

๐Ÿ“ถ Technologies

๐Ÿ’พ Setup

  • Install dependencies using npm i then run ng serve for a dev server. No API key required.
  • Navigate to http://localhost:4200/. The app does automatically reload if you change any of the source files.
  • Open a second terminal and run npm run api for a local JSON server. Navigate to http://localhost:3000/. The json file will update if a movie is added from the front-end 'add movie' page.

๐Ÿ’ป Code Examples

  • movie-list.component.html extract showing HTML to load movies asynchronously with a loading image until they are shown.
<!--if there are movies then show them in the DOM using Angular async pipe-->
<ul *ngIf="movies$ | async as movies; else loading" [@listAnimation]="movies">
  <li *ngFor="let movie of movies">
    <a [routerLink]="movie.id">
      <img [src]="movie.image" />
    </a>
  </li>
</ul>

<ng-template #loading>
  <ul [@listAnimation]="loadingMovies.length">
    <li
      *ngFor="let movie of loadingMovies"
      [@listAnimation]="loadingMovies.length"
    >
      <img src="/assets/movie.png" />
    </li>
  </ul>
</ng-template>

๐Ÿ†’ Features

  • Angular Reactive Forms (model-driven forms) are used instead of the html template-driven method.
  • BrowserAnimations used to add some animation to the movie details loading.
  • Working backend on port 3000 was very easy to setup and run.

๐Ÿ“‹ Status & To-Do List

  • Status: Working.
  • To-Do: Add a nav back button on detail page.

๐Ÿ‘ Inspiration

๐Ÿ“ License

  • This project is licensed under the terms of the MIT license.

โœ‰๏ธ Contact

angular-movie-database's People

Contributors

andrewjbateman avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.