VanillaMasker, jsTag

15 Jul 2014 | By Alex Young | Tags jquery angularjs ui

VanillaMasker

VanillaMasker (GitHub: BankFacil / vanilla-masker, License: MIT) by Caio Ribeiro Pereira is a small library for masking input elements with formats. It supports money, numbers, and custom patterns.

For example, a simple date mask would look like this:

masker.toPattern(12122000, "99/99/9999");

It doesn’t have any dependencies (hence “vanilla”), unless you want to build it locally.

jsTag

jsTag (GitHub: eranhirs / jsTag, License: MIT, Bower: jsTag) by Eran Hirsch is an AngularJS library for handling rich tag input fields. To use it, add a js-tag element to your HTML, and then add the js-tag-options directive for specifying a placeholder and default tag values.

You can also access it in JavaScript like this:

demoApp.controller('CustomizedController', ['$scope', function($scope) {
  // Export jsTag's options
  $scope.jsTagOptions = {
    'texts': {
      'inputPlaceHolder': 'Type text here'
    },
    'defaultTags': ['Default Tag #1', 'Default Tag #2']
  };
}]);

The documentation includes an example of using it with Twitter’s typeahead.js project.


blog comments powered by Disqus