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();  
 }  

Posted in Labels: |

0 comments:

Post a Comment