Coder Social home page Coder Social logo

rnadler / ng2-password-strength-bar Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 17.0 1.05 MB

Angular 2/4/5 Password Strength Bar

Home Page: http://bobonmedicaldevicesoftware.com/blog/2016/12/09/publishing-an-angular-2-component-npm-package/

License: MIT License

TypeScript 43.47% HTML 2.71% JavaScript 53.82%

ng2-password-strength-bar's People

Contributors

bogdanbaghiu avatar btxtiger avatar evansmwendwa avatar feeloor avatar johnfedoruk avatar karolmie1 avatar rnadler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ng2-password-strength-bar's Issues

"Issue"

Hey,

first of all I just want to say that this is very nice component!

This is not an issue, it's more suggestion that you could add some @output so we could use password strength for form validations in future version.

Thanks! ๐Ÿ‘ :)

How to adjust points width

Hi,

How can I adjust the points width?

I have tried the following code with no luck:

.strengthBar[_ngcontent-c2] .point[_ngcontent-c2] { width: 40px !important; }

PasswordStrengthBarModule' is not exported by node_modules\ng2-password-strength-bar\index.js

After compiling my app with AOT I'm going through the process of tree-shakin my bundle. But when I start node_modules/.bin/rollup -c rollup-config.js after a few seconds the systems quits with the following error message:

๏ฟฝ 'PasswordStrengthBarModule' is not exported by node_modules\ng2-password-strength-bar\index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
src\app\app.module.js (58:9)

Any ideas how to fix this?
Thanks in advance.
OASE

Not compatible with Anuglar 9.1 and Ivy

When upgrading from Angular 8 to 9.1 the compiler give that error.

This likely means that the library (ngx-store) which declares WebStorageModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

Any idea?

ERROR TypeError: Cannot read property 'currentValue' of undefined

Hello.

I am trying to change the barLabel tag based on the language. When I change from English to Spanish I should change "Password consistent" to "Password consistency" but it gives me the following error.
I have observed that it looks if the currentValue of the password is
var password = changes['passwordToCheck'].currentValue;
It is seen that the passwordToCheck is undefined and cannot read currentValue.

EditUserPage.html:22 ERROR TypeError: Cannot read property 'currentValue' of undefined at PasswordStrengthBarComponent.push../node_modules/ng2-password-strength-bar/lib/passwordStrengthBar.component.js.PasswordStrengthBarComponent.ngOnChanges (passwordStrengthBar.component.js:77) at checkAndUpdateDirectiveInline (core.js:27784) at checkAndUpdateNodeInline (core.js:38472) at checkAndUpdateNode (core.js:38411) at debugCheckAndUpdateNode (core.js:39433) at debugCheckDirectivesFn (core.js:39376) at Object.eval [as updateDirectives] (EditUserPage.html:23) at Object.debugUpdateDirectives [as updateDirectives] (core.js:39364) at checkAndUpdateView (core.js:38376) at callViewAction (core.js:38742)

FeatureRequest: Define custom colors

I'd like to adjust the bar colors to my page theme.
An option could be to pass an array to the directive to overwrite the defaults:

<ng2-password-strength-bar 
    [colors]="myColors" 
    [passwordToCheck]="formData.passwd" 
    barLabel="Security: ">
</ng2-password-strength-bar>
export class myComponent {
   public myColors = [โ€˜#F00โ€™, โ€˜#F90โ€™, โ€˜#FF0โ€™, โ€˜#9F0โ€™, โ€˜#0F0โ€™];
}

Move angular dependencies to dev dependencies.

When I'm using this module npm forces me to download version of angular that I didn't want to use.
Only angular core should be main dependency, and version 2.whatever would be enough.
Other angular dependencies are used only for tests, and should be treated as dev deps.

Access the strength value?

I have the password strength bar working great, thanks. However I can't seem to see anywhere how I can use the strength value to do things like enable a Submit button. How can you access - possibly with an isValid sort of property or anything really?

Thanks!
Craig

Change detection OnPush maybe?

All changes are done on Input change, so OnPush strategy would be viable, and would provide that sweet sweet performance boost.

changeDetection: ChangeDetectionStrategy.OnPush`

Move Project to Angular 5

Maybe this project should be moved to Angular 5, in order to have angular-cli and webpack as module bundler. This would be a lot more handy and simpler. Currently every change in src/ needs a restart, because even if systemjs detects the change and reloads, tsc does not recompile.

Uncaught Error: Unexpected value 'PasswordStrengthBar' declared by the module 'AppModule'

Versions.
angular-cli: 1.0.0-beta.15
node: 5.0.0
os: win32 x64

I am trying to use 'ng2-password-strength-bar' in my application.
When i try to import it in my app.module.ts file:

import { PasswordStrengthBar } from "ng2-password-strength-bar";

@NgModule({
declarations: [
AppComponent,
PasswordStrengthBar]

it is giving me following runtime error (no compile time error):

Uncaught Error: Unexpected value 'PasswordStrengthBar' declared by the module 'AppModule'
at http://localhost:4200/main.bundle.js:28457:31
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (http://localhost:4200/main.bundle.js:28444:49)
at RuntimeCompiler._compileComponents (http://localhost:4200/main.bundle.js:44967:47)
at RuntimeCompiler.compileModuleAndComponents (http://localhost:4200/main.bundle.js:44905:37)
at RuntimeCompiler.compileModuleAsync (http://localhost:4200/main.bundle.js:44896:21)
at PlatformRef
.bootstrapModuleWithZone (http://localhost:4200/main.bundle.js:30834:25)
at PlatformRef
.bootstrapModule (http://localhost:4200/main.bundle.js:30816:21)
at Object. (http://localhost:4200/main.bundle.js:62874:124)
at webpack_require (http://localhost:4200/inline.js:53:30)

How to implement this in Angular's reactive form ?

Hello,

I'm relatively new to Angular 2. So when I implemented the validations, I used reactive forms instead of going with ngModel.
In the example you only specify with ngModel. Can this be implemented in reactive form ?

Thanks.

(index):25 Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:49339/node_modules/ng2-password-strength-bar/lib/passwordStrengthBar.module

i add the package on my system.config.js

System.config ({
path: {
'npm:': 'node_modules/'
},
map: {
'app': '/app'

(...)Other packages

'ng2-password-strength-bar': 'npm:ng2-password-strength-bar/index.js',

},
}
and this is the problem

(index):25 Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:49339/node_modules/ng2-password-strength-bar/lib/passwordStrengthBar.module
Error: XHR error (404 Not Found) loading http://localhost:49339/node_modules/ng2-password-strength-bar/lib/passwordStrengthBar.module
at XMLHttpRequest.wrapFn [as __zone_symbol___onreadystatechange] (http://localhost:49339/node_modules/zone.js/dist/zone.js:1070:39)
at ZoneDelegate.invokeTask (http://localhost:49339/node_modules/zone.js/dist/zone.js:424:31)
at Zone.runTask (http://localhost:49339/node_modules/zone.js/dist/zone.js:191:47)
at ZoneTask.invokeTask [as invoke] (http://localhost:49339/node_modules/zone.js/dist/zone.js:499:34)
at invokeTask (http://localhost:49339/node_modules/zone.js/dist/zone.js:1349:10)
at XMLHttpRequest.globalZoneAwareCallback (http://localhost:49339/node_modules/zone.js/dist/zone.js:1358:13)
Error loading http://localhost:49339/node_modules/ng2-password-strength-bar/lib/passwordStrengthBar.module as "./lib/passwordStrengthBar.module" from http://localhost:49339/node_modules/ng2-password-strength-bar/index.js
at XMLHttpRequest.wrapFn [as __zone_symbol___onreadystatechange] (http://localhost:49339/node_modules/zone.js/dist/zone.js:1070:39)
at ZoneDelegate.invokeTask (http://localhost:49339/node_modules/zone.js/dist/zone.js:424:31)
at Zone.runTask (http://localhost:49339/node_modules/zone.js/dist/zone.js:191:47)
at ZoneTask.invokeTask [as invoke] (http://localhost:49339/node_modules/zone.js/dist/zone.js:499:34)
at invokeTask (http://localhost:49339/node_modules/zone.js/dist/zone.js:1349:10)
at XMLHttpRequest.globalZoneAwareCallback (http://localhost:49339/node_modules/zone.js/dist/zone.js:1358:13)
Error loading http://localhost:49339/node_modules/ng2-password-strength-bar/lib/passwordStrengthBar.module as "./lib/passwordStrengthBar.module" from http://localhost:49339/node_modules/ng2-password-strength-bar/index.

How can I configure the rules ?

Hello,

I would like to have the possibility to configure the rules, like changing the minimum length of a password to be considered strong. Is this possible ?

Cheers

Erro while "ng build --prod --aot"

ERROR in Error encountered resolving symbol values statically. Calling function 'makeParamDecorator', function c
alls are not supported. Consider replacing the function or lambda with a reference to an exported function, reso
lving symbol Injectable in D:/Praveen data/angular/Merchat Project/node_modules/ng2-password-strength-bar/node_m
odules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in D:/Praveen data/angular/Merchat Proje
ct/node_modules/ng2-password-strength-bar/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol
OpaqueToken in D:/Praveen data/angular/Merchat Project/node_modules/ng2-password-strength-bar/node_modules/@angu
lar/core/src/di/opaque_token.d.ts

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'D:\Praveen data\angular\Mercha
t Project\src'
@ ./src/main.ts 5:0-74
@ multi ./src/main.ts

NPM Install Fails with "Class 'Subject<T>' incorrectly extends base class 'Observable<T>'"

Local Versions

  • npm: 4.0.3
  • angular/cli: 1.3.2
  • node: 7.4.0
  • os: linux x64
  • angular/common: 2.4.10
  • angular/compiler: 2.4.10
  • angular/compiler-cli: 2.4.10
  • angular/core: 2.4.10
  • angular/forms: 2.4.10
  • angular/http: 2.4.10
  • angular/platform-browser: 2.4.10
  • angular/platform-browser-dynamic: 2.4.10
  • angular/platform-server: 2.4.10
  • angular/router: 3.4.10

NPM stderr

$ npm install > /dev/null
npm WARN prepublish-on-install As of npm@5, prepublish scripts will run only for npm publish.
npm WARN prepublish-on-install (In npm@4 and previous versions, it also runs for npm install.)
npm WARN prepublish-on-install See the deprecation note in npm help scripts for more information.
Error at /var/www/wiser/ng2-password-strength-bar/node_modules/rxjs/Subject.d.ts:16:22: Class 'Subject' incorrectly extends base class 'Observable'.
Types of property 'lift' are incompatible.
Type '(operator: Operator<T, R>) => Observable' is not assignable to type '(operator: Operator<T, R>) => Observable'.
Type 'Observable' is not assignable to type 'Observable'.
Type 'T' is not assignable to type 'R'.

npm ERR! Linux 4.4.0-79-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ngc-build"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] ngc-build: rm -rf lib && rm -rf "src/node_modules" && "node_modules/.bin/ngc" -p tsconfig-aot.json
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] ngc-build script 'rm -rf lib && rm -rf "src/node_modules" && "node_modules/.bin/ngc" -p tsconfig-aot.json'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ng2-password-strength-bar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! rm -rf lib && rm -rf "src/node_modules" && "node_modules/.bin/ngc" -p tsconfig-aot.json
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ng2-password-strength-bar
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ng2-password-strength-bar
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /var/www/wiser/ng2-password-strength-bar/npm-debug.log

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-79-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] prepublish: npm run ngc-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepublish script 'npm run ngc-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ng2-password-strength-bar package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run ngc-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ng2-password-strength-bar
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ng2-password-strength-bar
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /var/www/wiser/ng2-password-strength-bar/npm-debug.log

Get level of security as integer

Maybe Feature Request:

Is ist already possible to retrieve the security-level as integer, so I can forbid passwords with a lower security-level than "3" ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.