ABN validation directive for AngularJS. Uses the Australian Taxation Office (ATO) ABN verification formula.
View the demo at jmontagu.github.io/ng-AustralianBusinessNumber/
Download the latest release
-
Add src/australianBusinessNumber.js to your solution
-
Add the australianBusinessNumber module as a dependency to your application module:
var myAppModule = angular.module('MyApp', ['australianBusinessNumber']);
-
Add the attribute 'abn' to your form elements like so:
<input abn type="text" ng-model="client.abn" />
To make the element mandatory:
<input abn required type="text" ng-model="client.abn" />
To display a validation error:
<form name="form">
<input name="abnInput" ng-model="client.abn" abn />
<span ng-show="form.$error.abnInput">Invalid ABN</span>
</form>
- Install Karma, Grunt, Bower
$ npm install -g karma grunt-cli bower
- Install development dependencies
$ npm install
- Install components
$ bower install
This project uses Grunt to check for JavaScript syntax errors and execute all unit tests. To run Grunt, simply execute:
$ grunt
This code is released under the MIT license.