Skip to content

Instantly share code, notes, and snippets.

@arnaudvalle
Forked from matmkian/service.js
Created September 9, 2016 14:51
Show Gist options
  • Save arnaudvalle/95079a790159c37f4cc800849d362767 to your computer and use it in GitHub Desktop.
Save arnaudvalle/95079a790159c37f4cc800849d362767 to your computer and use it in GitHub Desktop.
(function()
{
'use strict';
angular
.module('Services')
.service('MyService', MyService);
/* @ngInject */
function MyService()
{
var service = this;
// Private members
var _privateMember = 'example';
// Public members
service.publicMember = 'example';
// Public methods
service.publicMethod = publicMethod;
////////////////////////////////////
/**
* Method description
* @param {string} param
* @return {string}
*/
function publicMethod(param)
{
_privateMember = param;
return _privateMember;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment