You can install bcryptjs (npm install bcryptjs
) and use the following code:
import * as bcrypt from 'bcryptjs';
const salt = bcrypt.genSaltSync(10);
pass = bcrypt.hashSync(this.loginForm.value.password, salt);
Your code must look like:
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import *
β¦
Top comments (0)