In plain javascript, I can group similar functions into an object like so:
var Monolog = {
notify: function(title, message) {
// Do something with title and message
},
confirm: function(title, message, func) {
// Do something with title, message and func
}
}
Which I can access like so:
Monolog.notify('Error', 'Error message');
Now, using AngularJS, I need the functions inside Monolog to change a $scope.variable, which mean that I would either have to use service or the rootScope.
How would I do this?
$rootScope$rootScopefor this, that is a fundamental misunderstanding of how$rootScopeworks. Beyond that, "Global" is never good.