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

JMontagu/ng-AustralianBusinessNumber

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/

Download

Download the latest release

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']);
  3. 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>

Requirements

Project setup

  1. Install Karma, Grunt, 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

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

Packages

No packages published