XRegExp validator for AngularJS. This library decorates ngPattern to use XRegExp for more complex regular expression.
You can choose your preferred method of installation:
- Through bower:
bower install angular-xregexp --save
- Through npm:
npm install angular-xregexp xregexp --save
- Download from github: angular-xregexp.min.js
Include both xregexp-all.js and angular-xregexp.js in your application.
<script src="components/xregexp/xregexp-all.js"></script>
<script src="components/angular-xregexp/angular-xregexp.js"></script>
Add the module angularXRegExp
as a dependency to your app module:
var myapp = angular.module('myapp', ['angularXRegExp']);
Then just use ng-pattern
as always.
Released under the terms of the MIT License.