Skip to content
This repository has been archived by the owner on Dec 15, 2017. It is now read-only.

Latest commit

 

History

History
51 lines (31 loc) · 1.47 KB

README.md

File metadata and controls

51 lines (31 loc) · 1.47 KB

ARCHIVED

This addon is no longer maintained. Please use https://github.com/pzuraq/ember-inputmask instead.

ember-cli-input-mask

An ember-cli addon for creating input masks on text fields. It makes use of the jquery.inputmask plugin to assist users in entering text that matches the required format.

Installation

To install this addon in your ember application:

  • ember install:addon ember-cli-input-mask

Usage

In your handlebars template:

{{input-mask
  mask='000-00-0000'}}

This addon's input-mask component extends an Ember.TextField. See the Ember input helpers guides for information on the available attributes.

A very common case will be to set a value:

{{input-mask
  value=myInputValue
  mask='000-00-0000'}}

Your value can be a JS date if you use jquery.inputmask's built-in date type, and it will be handled correctly:

{{input-mask
  value=myJsDateValue
  mask='mm/dd/yyyy'}}

See jquery.inputmask's masking types docs for more information on defining masks.

Running Tests

  • ember test

Credits

This addon was born from a blog post by Peter Brown of Agilion.