Angular controller can't get data from service
问题 Background: I'm learning AngularJS, I've written sample code to create a service for a module, and pass the data from service into one of the module's controller, all works fine. But yesterday when I tried to pass the following service's data into a controller, it just show the data is undefined, and I don't know why. var notif = angular.module('testnotif',[]); notif.service('sharedUsers', ['$http', function($http){ var url = current_dir+'/testNotif/getAllUsersjson'; var allUsers = []; var