Reimplements the recents feature
This commit is contained in:
22
webapp/js/directives.js
Normal file
22
webapp/js/directives.js
Normal file
@@ -0,0 +1,22 @@
|
||||
var directives = angular.module('satbd.satellite.bar.directives',[])
|
||||
|
||||
directives.directive('album', function() {
|
||||
return {
|
||||
scope: {
|
||||
id: '=albumId'
|
||||
},
|
||||
templateUrl: 'js/directives/album.html',
|
||||
restrict: 'A',
|
||||
controller: 'AlbumCtrl'
|
||||
};
|
||||
});
|
||||
|
||||
directives.controller('AlbumCtrl', function($scope,$http,$log,albumService) {
|
||||
albumService.get($scope.id)
|
||||
.then(function(data) {
|
||||
$scope.album = data;
|
||||
$log.info('Got : ' + data.ID);
|
||||
}, function(err) {
|
||||
$log.error('Got error :' + err);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user