(function () { 'use strict'; angular .module('app') .controller('TestHelloCtrl', TestHelloCtrl); TestHelloCtrl.$inject = ['$scope', 'smartRequest', '$location', 'Notification']; function TestHelloCtrl($scope, smartRequest, $location, Notification) { $scope.users = []; $scope.getUsers = function () { smartRequest.get('php/hello', function (data) { $scope.users = data.users; }); }; $scope.update = function () { $scope.getUsers(); }; $scope.update(); } })();