Lets Have a fun with Technology.

BTemplates.com

Follow by Email

Thursday, June 22, 2017

Generate Guid In Angular 2 Application (type Script)


Generate Guid In Angular 2 Application (type Script)


Hello,

Below is code block to generate GUID in angular 2 application.


 function newguidgen() {  
  function id() {  
   return Math.floor((1 + Math.random()) * 0x10000)  
    .toString(16)  
    .substring(1);  
  }  
  return id() + id() + '-' + id() + '-' + id() + '-' +  
   id() + '-' + id() + id() + id();  
 }  

0 comments:

Post a Comment