Files
meanTorrent/modules/core/client/controllers/home.client.controller.js
2017-04-01 15:00:59 +08:00

37 lines
1.0 KiB
JavaScript

(function () {
'use strict';
angular
.module('core')
.controller('HomeController', HomeController);
HomeController.$inject = ['$scope', '$translate', 'TorrentsService', 'Notification'];
function HomeController($scope, $translate, TorrentsService, Notification) {
var vm = this;
vm.info_is_ready = false;
//$translate.use('en');
vm.COMING = 'coming soon...';
vm.initInfo = function () {
TorrentsService.getTMDBInfo({
tmdbid: '329865',
language: 'en'
}, function (res) {
Notification.success({
message: '<i class="glyphicon glyphicon-ok"></i> ' + $translate.instant('TMDB_ID_OK')
});
vm.movieinfo = res;
vm.info_is_ready = true;
$('.backdrop').css('backgroundImage', 'url(http://image.tmdb.org/t/p/w500' + res.backdrop_path + ')');
}, function (err) {
Notification.error({
message: '<i class="glyphicon glyphicon-remove"></i> ' + $translate.instant('TMDB_ID_ERROR')
});
});
};
}
}());