AlphaGit / ng-pattern-restrict

Allowing only certain inputs based on a regex pattern, for AngularJS
http://alphagit.github.io/ng-pattern-restrict/
MIT License
47 stars 32 forks source link

Add mention of adding 'ngPatternRestrict' to app modules in README.md #51

Closed aplocher closed 7 years ago

aplocher commented 7 years ago

README.md misses a generally well-known (but crucial) step between installation and usage.

Currently installation says:

Installation bower install ng-pattern-restrict # or npm install ng-pattern-restrict Alternatively, copy the ng-pattern-restrict.js (or the minified version ng-pattern-restrict.min.js) into your project, load it into the browser and use it away.

Recommended update (changed last sentence and added a couple new lines with example):

Installation bower install ng-pattern-restrict # or npm install ng-pattern-restrict

Alternatively, copy the ng-pattern-restrict.js (or the minified version ng-pattern-restrict.min.js) into your project and reference it in your index.html.

Finally, add a module reference (typically in app.js) to ngPatternRestrict. e.g.:

angular.module('yourApp', [ ... other modules ..., 'ngPatternRestrict']);

AlphaGit commented 7 years ago

👍 Sounds like a good idea. I'll be updating it pretty soon.

aplocher commented 7 years ago

Thank you! I was brain-dead the other night working on this stuff and stared at my code for about 20 mins before realizing I forgot that! :-)

AlphaGit commented 7 years ago

Haha, not a problem. Thanks for turning your bad experience into something useful for everyone. That's the open source spirit at its best! 👍