From 4ee0a864e0fc435062a7875c5527d03d371645ef Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Mon, 9 Feb 2015 00:00:39 -0500 Subject: [PATCH] very basic --- app.js | 19 +++++++++++++++++++ index.html | 24 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 app.js create mode 100644 index.html diff --git a/app.js b/app.js new file mode 100644 index 0000000..15c061d --- /dev/null +++ b/app.js @@ -0,0 +1,19 @@ +var OMDBApp = angular.module('OMDBApp', []); + +OMDBApp.controller('AppCtrl', ['$scope', '$http', function ($scope, $http) { + $scope.movies = []; + + $scope.result; + + $scope.search = function() { + $http.get('http://www.omdbapi.com/?s='+$scope.query+'&r=json').success(function(data) { + $scope.movies = data.Search; + }); + }; + + $scope.showDescription = function(id){ + $http.get('http://www.omdbapi.com/?i='+id+'&r=json').success(function(data) { + $scope.result = data; + }); + } +}]); \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..51d98df --- /dev/null +++ b/index.html @@ -0,0 +1,24 @@ + + + + + +

Awesome Movie DB Site

+
+ +
+ + +
+ {{result.Title}}, {{result.Year}} +

+ {{result.Plot}} +

+
+ + + + + \ No newline at end of file