You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
504 B
19 lines
504 B
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;
|
|
});
|
|
}
|
|
}]); |