There are multiple ways of adding the required files:
-
Clone, build the repository, and include the files
-
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']);
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'
}]);