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
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());
}
try this (https://github.com/wulfsolter/angular2-uuid
)
As the doc say :
import { UuidService } from 'angular2-uuid';
constructor(private uuid: UuidService) //<-- pass it in contructor as service
const uuid = this.uuid.generate(); //<-- use it
Hope it helps you! ..as you can see it changed a little bit from what it report here (https://www.npmjs.com/package/angular2-uuid)
Issue fixed. Solution: I found out that when I did install the package angular2-uuid
via command-line, it was automatically stored in package.json
directly before/over the package: @angular/flex-layout
.
As the error was in a way not clear, I just did remove it to other position in the: package.json
and the error is gone. everything works fine.