.provider('myProvider1', function() {
var cfg = "";
return {
// function for use in config as myProvider1Provider
setConfig: function (value) {
cfg = value;
},
// use these in controller
$get: function ($http, $q, $scope) {
return {
myFunction1: function() {
return true;
},
myFunction2: function() {
return true;
}
}
}
})
It is a bit tricky to get hold of those from an out-of-scope function such as the onNotificationGCM.
One good solution is offered here: http://intown.biz/2014/04/11/android-notifications/
(look at code from line 60…)