Skip to content

Latest commit

 

History

History
 
 

ember

Ember Input Mask

Getting started

First, install it.

ember install ember-text-mask

Then, use it as follows:

Add the following markup to your template to render a masked input component.

{{masked-input mask=mask}}

In the template's controller, specify a mask.

import Ember from 'ember';

export default Ember.Controller.extend({

  mask: ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]

});

Documentation

For more information about the attributes that the masked-input component accepts, see the documentation here.

Example

To see an example of the code running, follow these steps:

You should have a working demo.

License

Public domain - CC0 1.0 Universal