Reorganizes the project with clean MVC structure

This commit is contained in:
2016-02-11 17:04:15 +01:00
parent 143274f369
commit e109e116f5
18 changed files with 187 additions and 219 deletions

View File

@@ -0,0 +1 @@
<h1> Albums Récents </h1>

View File

@@ -0,0 +1,20 @@
'use strict';
angular.module('satbd.satellite.bar.views.recents',[
'ngRoute'
]).config(function($routeProvider) {
$routeProvider.when('/recents', {
templateUrl: 'js/views/recents/recents.html',
controller: 'RecentsCtrl'
});
}).controller('RecentsCtrl', function( $scope, $http, $log) {
$scope.albumIDs = [];
$http.get('/api/recents')
.success(function(data) {
for (var i=0; i < 10; i++) {
$scope.albumIDs.push(data[i]);
}
}).error(function(err){
$log.error(err);
});
});