Hello,

I try to use two differents services in my app named "regiePub" to send 
http request.

My first service works but not the second. 
I don't see why..


Help me please :)


*My main config :*


'use strict';

angular.module('regiePub', [
        'ngRoute',
        '*ogecServices*',
        '*unOgecService*'
    ])
    .config(function ($routeProvider) {
        $routeProvider
            .when('/', {
                templateUrl: 'views/home.html',
                controller: 'MainCtrl'
            })
            .when('/prestataire/:idPrestataire', {
                templateUrl: 'views/admin-prestataire.html',
                controller: 'PrestaCtrl'
            })
            .when('/espace-ogec/:idOgec', {
                templateUrl: 'views/admin-ogec.html',
                controller: 'OgecCtrl'
            })
            .otherwise({
                redirectTo: '/'
            });


    });





*My services.js : *

'use strict';

*//first service*
var ogecServices = angular.module('*ogecServices*',['ngResource']);

ogecServices.factory('Ogec',['$resource',
    function($resource){
        return $resource('data/ogec.json', {}, {
            listerOgec: {method:'GET', isArray:true}
        });
    }]);



*//second service*
var unOgecService = angular.module('*unOgecService*',['ngResource']);

unOgecService.factory('unOgec',['$resource',
    function($resource){
        return $resource('data/ogec.json', {}, {
            query: {method:'GET', isArray:true}
        });
    }]);



*My controller : *

'use strict';

var myApp =  angular.module('regiePub');


myApp.controller('OgecCtrl', ['$scope','unOgec',
    function ($scope,unOgec) {

        console.log("test: " + unOgec.query() )


    }]);







console.log("test: " + unOgec.query() ) 

=> it doesn't show me data..

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to