/angular-unit-converter

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

Primary LanguageJavaScriptMIT LicenseMIT

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