import { Injectable } from '@angular/core' ; import * as zxcvbn_ from 'zxcvbn' ; const zxcvbn = zxcvbn_ ; @ Injectable ( { providedIn : 'root' } ) export class PasswordStrengthMeterService { constructor ( ) { } public score ( password ) { const result = zxcvbn ( password ) ; return result . score ; } public scoreWithFeedback ( password ) { const result = zxcvbn ( password ) ; return { score : result . score , feedback : result . feedback } ; } }