A service has been developed in AngularJS, but it is not being utilized in the controller.
Service.js
var appService = angular.module("appService", []);
appService.service("bddService", function() {
var bdds = bdd;
this.getBdds = function(){
return bdds;
};
var bdd = [{
id : 1,
nom : "Activité commercial",
desc : "Information de l'activité commercial de l'entreprise Bou."
}];
});
Controller.js
(function(){
var accueilCtrl = angular.module("accueilCtrl", ['appService']);
accueilCtrl.controller('accueilCtrl', ['$scope', 'bddService', function($scope, bddService){
$scope.bdds = bddService.getBdds(); // No error, but no data
}]);
})();
The code exists in two separate files, and when combined into one file, it functions correctly (Service injection into controller with AngularJS). No errors are displayed in the console.