Archive for September, 2016

Angular 2 Password Strength Bar

Wednesday, September 28th, 2016

I spent a little time updating AngularJS Directive to test the strength of a password to be a pure Angular 2 component and thought I'd share.

A working demo and all of the code can be found here: Angular 2 Password Strength Bar.

Notes:

  • Upgraded to Typescript and used the OnChanges interface.
  • Incorporation of the bar is now component-based:

<password-strength-bar [passwordToCheck]="account.password"></password-strength-bar>

  • Removed direct DOM modification and replaced with Angular 2 dynamic in-line styles.
  • Removed JQuery dependence.

Enjoy!