Note: This fork implements functionality forcing the html to fit on a single line.
Important: This plugin requires angular version 1.3 or greater
Go to your project's root directory and type:
bower install ng-fi-text
Download the file from the "dist" folder of this repo, which has the newest version available, and then copy it to your project's folder.
Load the module in your application by adding it as a dependent module:
angular.module('app', ['ng-fi-text']);
ng-fi-text can be initialized in multiple divs inside a page. It only needs to be inside de app's scope.
It is very important to ensure the container div you will apply ng-fi-text have the css position set to relative or absolute, otherwise the plugin will place the fitting text in weird locations.
To make it work add the ng-fi-text attribute to a div:
<div ng-fi-text="{{ angular.model }}"></div>
Add the ng-fi-text attribute without any value and also add the ng-fi-text attribute with the current value assigned:
<div ng-fi-text ng-fi-text-html="{{ angular.model }}"></div>
If you want to add a rotation to the resulting div, add the ng-fi-text-rotate with a positive value for a clockwise movement and a negative one for the contrary one.
<div ng-fi-text="'This text will be upside down'" ng-fi-text-rotate="180"></div>
Leandro Bessone
MIT