Here is what I ended up doing
(function(angular) {
'use strict';
/**
* @ngdoc overview
* @name services.base64
*/
angular.module('services.base64', [])
.factory(
'Base64',
[function() {
/**
* @ngdoc service
* @name services.base64.Base64
* @description Provides encoding a string into base64, and decode base64 to a string
*/
return {
/**
* @ngdoc method
* @name encode
* @methodOf services.base64.Base64
* @param {string}
* input the string you want to encode as base64
* @returns {string} the base64 encoded string
*/
encode : function(input) {
//...
},
/**
* @ngdoc method
* @name decode
* @methodOf services.base64.Base64
* @param {string}
* input the base64 encoded string
* @returns {string} the decoded string
*/
decode : function(input) {
//...
}
};
}]);
}(angular));
This appears to do what I want...perhaps there is a less verbose way of doing though?