Skip to content

Instantly share code, notes, and snippets.

@matmkian
Created August 30, 2016 15:36
Show Gist options
  • Select an option

  • Save matmkian/75a21185397a43e211e882b41108a0e3 to your computer and use it in GitHub Desktop.

Select an option

Save matmkian/75a21185397a43e211e882b41108a0e3 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;
}
}
})();
@arnaudvalle
Copy link

il manque un return service; qqpart vers la fin je crois?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment