Reorganizes the project with clean MVC structure
This commit is contained in:
20
webapp/directives.js
Normal file
20
webapp/directives.js
Normal file
@@ -0,0 +1,20 @@
|
||||
var directives = angular.module('satbd.satellite.bar.directives')
|
||||
|
||||
directives.directive('album', function() {
|
||||
return {
|
||||
scope: {
|
||||
id: '@album-id'
|
||||
}
|
||||
templateUrl: 'js/directives/album.html',
|
||||
restrict: 'E',
|
||||
};
|
||||
});
|
||||
|
||||
directives.controller('albumCtrl', function($scope,$html) {
|
||||
$scope.init = function() {
|
||||
$http.get('/api/albums/'+ $scope.id)
|
||||
.success(function(data) {
|
||||
$scope.album = data;
|
||||
});
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user