angular-uuid
angular-uuid is an AngularJS wrapper for Robert Kieffer's node-uuid, which provides simple, fast generation of RFC4122 UUIDS.
Features
- AngularJS service – no global scope pollution
- Generate RFC4122 version 1 or version 4 UUIDs
- Cryptographically strong random # generation on supporting platforms
- Tiny file size when minified.
Installation
If using CommonJS then simply require angular-uuid as per usual, prior to setting up your AngularJS modules (but after including angular):
npm install --save angular-uuid
;
Otherwise use a regular script tag (after including angular):
Angular Module Usage
Ensure that you include angular-uuid in your module definition:
var CoolApp = angular;
You can then inject uuid where necessary, for example:
CoolApp; { var hash = uuid; console;}
Documentation
Full documentation is available via the original project's readme: https://github.com/broofa/node-uuid/blob/master/README.md