ng-transiterate

AngularJS directive for eased iteration display
0 people use it
Author: 807449? witq

ng-transiterate

AngularJS directive for eased iteration display

illustration

Demo

A working demo can be foud at the project's website: http://witq.github.io/ng-transiterate

Install

The preferred installation method is just using Bower, like that:

$ bower install ng-transiterate

Remember to load the script file in your view:

<script src="bower_components/ng-transiterate/dist/ng-transiterate.js"></script>

Then, reference the module (ngTransiterate) in your app:

angular.module('myApp', ['ngTransiterate']);

Use

The directive is very easy to use. The minimal working usage looks like that:

<div transiterate="value"></div>

Where value is any numerical value bound to $scope. The directive sets the element's content to the supplied values and animates any changes.

Optional attributes

duration

Sets the animation duration in miliseconds. Default is 800.

<div transiterate="value" duration="6000"></div>

easing

Sets the easing method. This can be any of the Robert Penner's easing functions. Default it "easeInOutExpo".

<div transiterate="value" easing="easeOutQuad"></div>

precision

Sets how precisely should floating numbers be displayed. Default is 0 (display as rounded integers). This parameter is used only when no filter is selected.

<div transiterate="value" precision="2"></div>

filter

Sets which angular filter the directive should use for display. Default is none. If a filter requires parameters, they should be passed like that: number:3. This sets the filter to number with optional fractionSize parameter.

<div transiterate="value" filter="number:3"></div>

comments powered by Disqus
This page was last updated over 2 years ago.