Skip to content

atilla8huno/br-filters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular's Brazilian Filters

MIT License Bower Build Status

Installing

There are multiple ways of adding the required files:

  1. Clone, build the repository, and include the files

  2. Install via Bower and include files

bower install br-filters

reference the script

<script src="bower_components/br-filters/dist/br-filters.min.js"></script>

Include the br-filters module in your application

var app = angular.module('myapp', ['br-filters']);

Basic example

The most basic use of the directive in html (plunker)

CPF before: <span ng-bind="cpf"></span>
CPF then: <span ng-bind="cpf | cpf"></span>

Or with an angular controller:

angular.module('myapp')
  .controller('ctrl', ['$scope', '$filter', function ($scope, $filter){

    $scope.cnpj = $filter('cnpj')('45215458000104');
    // $scope.cnpj -> will be '45.215.458/0001-04'
}]);