How to generate UUID with angular 2?

后端 未结 3 646
野的像风
野的像风 2021-01-31 08:45

I\'m using Angular 2 for a signup form: first name, last name, email and password.

After submit, the data is being stored via API call in a database (nodeJs and mongo) a

3条回答
  •  暖寄归人
    2021-01-31 09:05

    It's downloaded as a part of Angular's dependency, use it like:

    import { v4 as uuid } from 'uuid';
    
    @Component(..)
    export class AppComponent {
    
      console.log('new uid: ', uuid());
    }
    

提交回复
热议问题