-TMDB API Programming Test
+Awesome TMDB App
+
diff --git a/src/main/tmdb/directives/money.js b/src/main/tmdb/directives/money.js
new file mode 100644
index 0000000..0ae89b3
--- /dev/null
+++ b/src/main/tmdb/directives/money.js
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+
+define( [ 'angular', 'tmdb/partials/money/MoneyController'],
+ function(angular, MoneyController) {
+ "use strict";
+
+ return function() {
+ return {
+ transclude: true,
+ replace: true,
+ controller: MoneyController,
+ templateUrl: '/tmdb/partials/money/money.html',
+ restrict: 'E',
+ scope: {
+ budget: '=',
+ revenue: '='
+ }
+ };
+ };
+ }
+);
\ No newline at end of file
diff --git a/src/main/tmdb/partials/awesomeSearch/AwesomeSearchController.js b/src/main/tmdb/partials/awesomeSearch/AwesomeSearchController.js
index efe475e..3bf91c1 100644
--- a/src/main/tmdb/partials/awesomeSearch/AwesomeSearchController.js
+++ b/src/main/tmdb/partials/awesomeSearch/AwesomeSearchController.js
@@ -31,7 +31,7 @@ define( [ 'angular',
var limitName = 24;
var config = angular.module("config");
- var defaultImage = "http://simpleicon.com/wp-content/uploads/movie-1.png";
+ var defaultImage = "https://simpleicon.com/wp-content/uploads/movie-1.png";
$scope.searchPhrase = "";
diff --git a/src/main/tmdb/partials/money/MoneyController.js b/src/main/tmdb/partials/money/MoneyController.js
new file mode 100644
index 0000000..7236509
--- /dev/null
+++ b/src/main/tmdb/partials/money/MoneyController.js
@@ -0,0 +1,50 @@
+/**
+ * MovieController provides controller support for fetching movies from tmdb
+ *
+ * @module tmdb.partials.movie.MovieController
+ *
+ * @requires angular
+ * @requires ngRoute
+ * @requires config
+ * @requires TMDBAPIService
+ *
+ * @author Barry Skidmore
+ *
+ * @returns instance of the MovieController
+ *
+ * @copyright Alert Logic, Inc 2014
+ *
+ */
+
+define(['angular',
+ 'ngRoute',
+ 'config/config',
+ 'tmdb/services/TMDBAPIService'
+ ],
+ function(angular, $routeParams, config, TMDBAPIService) {
+ "use strict";
+
+ var MoneyController = function($scope, TMDBAPIService, $routeParams) {
+
+ $scope.num_icons_budget = Math.floor($scope.budget / 100000000);
+ $scope.num_icons_revenue = Math.floor($scope.revenue / 100000000);
+ if ($scope.num_icons_budget === 0) {
+ $scope.num_icons_budget = 1;
+ }
+ if ($scope.num_icons_revenue === 0) {
+ $scope.num_icons_revenue = 1;
+ }
+
+ $scope.range = function(min, max, step) {
+ step = step || 1;
+ var input = [];
+ for (var i = min; i <= max; i += step){ input.push(i);}
+ return input;
+ };
+
+ };
+
+ MoneyController.$inject = ['$scope', 'TMDBAPIService', '$routeParams'];
+ return MoneyController;
+ }
+);
\ No newline at end of file
diff --git a/src/main/tmdb/partials/money/money.html b/src/main/tmdb/partials/money/money.html
new file mode 100644
index 0000000..b559504
--- /dev/null
+++ b/src/main/tmdb/partials/money/money.html
@@ -0,0 +1,10 @@
+
+
+
+ Budget $ {{ budget | number }} USD
+
+
+
+ Revenue $ {{ revenue | number }} USD
+
+
\ No newline at end of file
diff --git a/src/main/tmdb/partials/movie/detail.html b/src/main/tmdb/partials/movie/detail.html
index e159a00..7626346 100644
--- a/src/main/tmdb/partials/movie/detail.html
+++ b/src/main/tmdb/partials/movie/detail.html
@@ -19,14 +19,11 @@
{{ detail.details.tagline }}
Running Time {{ detail.details.runtime }} minutes
-
-
- Budget ${{ detail.details.budget | number }} USD
-
-
- Revenue ${{ detail.details.revenue | number }} USD
-