alexandernst / angular-unit-converter

AngularJS directive that converts to/from metric units using $parser and $formatters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AngularJS Unit Converter Build Status

AngularJS directive that converts to/from metric units using $parser and $formatters

How does it works

The idea behind this directive is to take a model's value and convert it from one unit to another, say from cm to mm, without changing the value itself, only the view value. Of course, the reverse way is supported too, aka parsing the view value and setting the model value.

This is very helpful when you want to represent a value in a different unit and let the user interact with it.

Demo

Plnkr demo

About

AngularJS directive that converts to/from metric units using $parser and $formatters

License:MIT License


Languages

Language:JavaScript 84.7%Language:HTML 15.3%