diff --git a/src/app/components/guid-service/guid.service.js b/src/app/components/guid-service/guid.service.js new file mode 100644 index 0000000..4c65bb5 --- /dev/null +++ b/src/app/components/guid-service/guid.service.js @@ -0,0 +1,24 @@ +(function() { + 'use strict'; + + angular + .module('dialoga') + .factory('GUID', GUID); + + /** @ngInject */ + function GUID(){ + var service = {}; + + service.generate = function (){ + function s4() { + return Math.floor((1 + Math.random()) * 0x10000) + .toString(16) + .substring(1); + } + return s4() + s4() + '-' + s4() + '-' + s4() + '-' + + s4() + '-' + s4() + s4() + s4(); + } + + return service; + } +})(); -- libgit2 0.21.2