-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58e85c3
commit 982d285
Showing
11 changed files
with
146 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<section class="jumbotron text-center text-light bg-green-blue"> | ||
<div class="container"> | ||
<h1>Trending movies</h1> | ||
<p class="lead">On big screens right now.</p> | ||
</div> | ||
</section> | ||
|
||
<div class="album py-5 bg-light"> | ||
<div *ngIf="movies" class="container"> | ||
<div class="row"> | ||
<div | ||
*ngFor="let movie of movies; index as id" | ||
class="order-{{ movie.vote_average }} col-12 col-md-6 col-lg-4 col-xl-3" | ||
> | ||
<div class="card mb-4 shadow-sm"> | ||
<a [routerLink]="['/view-movie', movie.id]" | ||
><img | ||
src="{{ | ||
movie.poster_path == null | ||
? 'assets/no-image.png' | ||
: 'https://image.tmdb.org/t/p/w185_and_h278_bestv2/' + | ||
movie.poster_path | ||
}}" | ||
class="poster_path bd-placeholder-img card-img-top" | ||
width="100%" | ||
focusable="false" | ||
role="img" | ||
/></a> | ||
<div class="card-body"> | ||
<h3 class="mb-0">{{ movie.title }}</h3> | ||
<p> | ||
<small class="text-muted" | ||
>Release: {{ movie.release_date }}</small | ||
> | ||
</p> | ||
<p class="card-text" style="height:120px;"> | ||
{{ movie.overview.substring(0, 200) }}... | ||
</p> | ||
<div class="d-flex justify-content-between align-items-center"> | ||
<div class="btn-group"> | ||
<button | ||
type="button" | ||
[routerLink]="['/view-movie', movie.id]" | ||
class="btn btn-sm btn-outline-secondary" | ||
> | ||
More info | ||
</button> | ||
</div> | ||
<small class="text-muted" | ||
>Average vote: {{ movie.vote_average }}</small | ||
> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { TrendingMoviesComponent } from './trending-movies.component'; | ||
|
||
describe('TrendingMoviesComponent', () => { | ||
let component: TrendingMoviesComponent; | ||
let fixture: ComponentFixture<TrendingMoviesComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ TrendingMoviesComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(TrendingMoviesComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component, OnInit } from "@angular/core"; | ||
import { HttpService } from "../http.service"; | ||
|
||
@Component({ | ||
selector: "app-trending-movies", | ||
templateUrl: "./trending-movies.component.html", | ||
styleUrls: ["./trending-movies.component.scss"] | ||
}) | ||
export class TrendingMoviesComponent implements OnInit { | ||
|
||
movies: any; | ||
genres: any; | ||
genreArray: any = []; | ||
|
||
constructor(private _http: HttpService) {} | ||
|
||
ngOnInit(): void { | ||
this._http.getTrendingMovies().subscribe(data => { | ||
this.movies = data["results"]; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters