Des Fonctions globales dans angularJS

Je suis nouveau sur angularJS. Si besoin d'aide sur la façon d'ajouter des fonctions globales dans angulaire du projet?
Chargement d'un fichier de mon angulaire de l'app est à l'aide de showScrollAndGo fonction de ce qui devrait être le travail en tant que méthode globale, mais il ne fonctionne pas. Code de app.js est:

'use strict'; define(
[
'angular',
'jQuery',
'angular-route',
'angular-resource',
'angular-ui-bootstrap',
'highcharts',
'highcharts-theme',
'highcharts-ng',
'controllers/index',
'directives/index',
'filters/index',
'services/index',
'angular-token-auth',
'angular-local-storage',
'jquery.slimscroll',
'jquery-icheck'
],
function(angular, $) {
'use strict';
return angular.module('radian', ['ngRoute', 'ngResource', 'ui.bootstrap', 'app.services', 'app.controllers', 'app.directives','app.filters', 'highcharts-ng', 'ng-token-auth', 'ngStorage'])
.constant('globals', {
API_URL: 'http://localhost:3000/api',
AUTH_URL: 'http://radiancor-env.elasticbeanstalk.com',
TEMPLATE_URL: 'app/views'
})
.constant('pagination', {
items_per_page: 10,
max_size: 5,
direction_links: true,
boundary_links: true,
current_page: 1,
total_items: 0
})
.config(['$routeProvider', 'globals', routeConfiguration])
.config(['$httpProvider', httpConfiguration])
.config(['$authProvider', 'globals', authProvider])
.config(['$rootScopeProvider', root_functions])
.config(['paginationConfig', paginationConfiguration]);
function authProvider($authProvider, globals) {
$authProvider.configure({
apiUrl: globals.AUTH_URL
});
}
function paginationConfiguration(paginationConfig) {
paginationConfig.firstText = '<<';
paginationConfig.lastText = '>>';
paginationConfig.nextText = '>';
paginationConfig.previousText = '<';
}
function routeConfiguration($routeProvider, globals) {
$routeProvider
.when('/', {
templateUrl: globals.TEMPLATE_URL+'/misc/login.html',
controller: 'LoginController',
controllerAs: 'login'
})
.when('/dashboard', {
templateUrl: globals.TEMPLATE_URL+'/misc/dashboard.html',
controller: 'DashboardController',
controllerAs: 'dashboard'
})
.when('/entity/:entity/:action', {
templateUrl: function(rp) {
return globals.TEMPLATE_URL+'/'+rp.entity+'/'+rp.action+'.html';
}
})
.when('/entity/:entity/:action/:id', {
templateUrl: function(rp) {
return globals.TEMPLATE_URL+'/'+rp.entity+'/'+rp.action+'.html';
}
})
.otherwise({
redirectTo: '/'
});
}
function httpConfiguration($httpProvider) {
$httpProvider.defaults.headers.common['Content-Type'] = 'application/json; charset=utf-8';
$httpProvider.defaults.headers.common['Accept'] = 'application/json, text/javascript';
$httpProvider.defaults.useXDomain = true;
$httpProvider.interceptors.push('interceptService');
}
function root_functions($rootScope) {
$rootScope.showScrollAndGo = function(path) {
alert("I'm global foo!");
};
}
});

J'ai besoin d'accéder showScrollAndGo dans les différents points de vue. Donc, essayer de faire à l'échelle mondiale.
Une idée où je fais de mal?

Je l'utilise en vue comme:

<a href="#/entity/clients/list" data-ng-click="showScrollAndGo('aaa');"><i class="fa fa-circle mrm mlm"></i>Manage Clients</a>
Il serait utile si vous pouviez montrer comment vous essayez d'appeler $rootScope.showScrollAndGo, et le message d'erreur que les résultats des appels à

OriginalL'auteur Adnan Ali | 2015-02-16