diff --git a/src/app/loader/loader.component.scss b/src/app/loader/loader.component.scss
index 19a8e9c..120d076 100644
--- a/src/app/loader/loader.component.scss
+++ b/src/app/loader/loader.component.scss
@@ -5,7 +5,7 @@
border-radius: 50%;
width: 50px;
height: 50px;
- animation: spin 0.8s linear infinite;
+ animation: spin 1s linear infinite;
margin: 20px auto;
}
diff --git a/src/app/movie/movie.component.html b/src/app/movie/movie.component.html
index ec5961d..e3788b1 100644
--- a/src/app/movie/movie.component.html
+++ b/src/app/movie/movie.component.html
@@ -8,18 +8,19 @@
{{movies.length}} Movies
-
- SORT BY:
-
diff --git a/src/app/movie/movie.component.scss b/src/app/movie/movie.component.scss
index bb2931c..c99f2e4 100644
--- a/src/app/movie/movie.component.scss
+++ b/src/app/movie/movie.component.scss
@@ -110,12 +110,14 @@
.ngmp-movie-year {
color: $grey;
margin: 0;
- margin-left: 34px;
+ margin-left: 70px;
}
.ngma-rateimg {
- height: 16px;
- position: relative;
+ height: 27px;
+ position: absolute;
width: 25px;
+ margin-top: 0px;
+ margin-left: -30px;
}
.ngmp-noimageposter {
text-align: center;
diff --git a/src/app/movie/movie.component.ts b/src/app/movie/movie.component.ts
index bd71631..588f05e 100644
--- a/src/app/movie/movie.component.ts
+++ b/src/app/movie/movie.component.ts
@@ -16,7 +16,7 @@ export class MovieComponent implements OnInit {
public MOVIE_PROPS = MOVIE_PROPS;
public loading: boolean;
- sortBy: any = "id";
+ sortBy: any = "Select";
public l = console.log;
constructor(private movieService: MovieService) {
@@ -44,4 +44,19 @@ export class MovieComponent implements OnInit {
showLoading(loading: boolean) {
this.loading = loading;
}
+
+ sortMovies() {
+ this.loading = true;
+ const sortValue = this.sortBy;
+ this.movies.sort((a: any, b: any) => {
+ if (a[sortValue] > b[sortValue]) {
+ return -1;
+ } else if (a[sortValue] < b[sortValue]) {
+ return 1;
+ } else {
+ return 0;
+ }
+ });
+ this.loading = false;
+ }
}
diff --git a/src/app/nav-menu/nav-menu.component.html b/src/app/nav-menu/nav-menu.component.html
index cb69d0c..695d305 100644
--- a/src/app/nav-menu/nav-menu.component.html
+++ b/src/app/nav-menu/nav-menu.component.html
@@ -2,9 +2,8 @@