Skip to content

AngularJS Australian Business Number (ABN) validation directive. Uses the official ATO validation formula.

License

Notifications You must be signed in to change notification settings

knowhoper/ng-AustralianBusinessNumber

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Australian Business Number (ABN) directive Build Status

ABN validation directive for AngularJS. Uses the Australian Taxation Office (ATO) ABN verification formula.

Demo

View the demo at jmontagu.github.io/ng-AustralianBusinessNumber/

Requirements

Setup

  1. Install Karma, Grunt and Bower $ npm install -g karma grunt-cli bower
  2. Install development dependencies $ npm install
  3. Install components $ bower install

Testing

This project uses Grunt to check for JavaScript syntax errors and execute all unit tests. To run Grunt, simply execute:

$ grunt

Usage

  1. Add src/australianBusinessNumber.js to your solution
  2. Add the australianBusinessNumber module as a dependency to your application module:
var myAppModule = angular.module('MyApp', ['australianBusinessNumber']);

Apply this directive to your form elements:

<input type="text" ng-model="client.abn" abn />

To make the element mandatory:

<input type="text" ng-model="client.abn" abn required />

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>

License

This code is released under the MIT license.

About

AngularJS Australian Business Number (ABN) validation directive. Uses the official ATO validation formula.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published