/* ng-FitText.js v3.1.0
 * https://github.com/patrickmarabeas/ng-FitText.js
 *
 * Original jQuery project: https://github.com/davatron5000/FitText.js
 * Includes use of Underscore's debounce function
 *
 * Copyright 2014, Patrick Marabeas http://marabeas.io
 * Released under the MIT license
 * http://opensource.org/licenses/mit-license.php
 *
 * Date: 18/10/2014
 */

(function(window, document, angular, undefined) {

  'use strict';

  angular.module('ngFitText', [])
    .value( 'config', {
      'debounce': false,
      'delay': 250,
      'min': undefined,
      'max': undefined
    })

    .directive('fittext', ['$timeout', 'config', 'fitTextConfig', function($timeout, config, fitTextConfig) {
      return {
        restrict: 'A',
        scope: true,
        link: function(scope, element, attrs) {
          angular.extend(config, fitTextConfig.config);

          element[0].style.display = 'inline-block';
          element[0].style.whiteSpace = 'nowrap';
          element[0].style.lineHeight = '1';

          var parent = element.parent();
          var compressor = attrs.fittext || 1;
          var minFontSize = attrs.fittextMin || config.min || Number.NEGATIVE_INFINITY;
          var maxFontSize = attrs.fittextMax || config.max || Number.POSITIVE_INFINITY;

          var resizer = function() {
            $timeout( function() {
              var ratio = element[0].offsetHeight / element[0].offsetWidth;
              element[0].style.fontSize = Math.max(
                Math.min(parent[0].offsetWidth * ratio * compressor,
                  parseFloat(maxFontSize)
                ),
                parseFloat(minFontSize)
              ) + 'px';
            },50);
          }; resizer();

          scope.$watch(attrs.ngModel, function() { resizer() });

          config.debounce
            ? angular.element(window).bind('resize', config.debounce(function(){ scope.$apply(resizer)}, config.delay))
            : angular.element(window).bind('resize', function(){ scope.$apply(resizer)});
        }
      }
    }])

    .provider('fitTextConfig', function() {
      var self = this;
      this.config = {};
      this.$get = function() {
        var extend = {};
        extend.config = self.config;
        return extend;
      };
      return this;
    });

})(window, document, angular);
@@ -13,17 +13,17 @@
 t.js v3.
-1
+2
 .0%0A * ht
@@ -351,18 +351,18 @@
 te: 
-18/10
+30/01
 /201
-4
+5
 %0A */
@@ -534,16 +534,39 @@
 ': 250,%0A
+      'loadDelay': 10,%0A
       'm
@@ -943,58 +943,8 @@
 k';%0A
-          element%5B0%5D.style.whiteSpace = 'nowrap';%0A
     
@@ -1073,16 +1073,86 @@
 t %7C%7C 1;%0A
+          var loadDelay = attrs.fittextLoadDelay %7C%7C config.loadDelay;%0A
         
@@ -1373,33 +1373,44 @@
     
-$timeout( function() %7B%0A  
+element%5B0%5D.style.fontSize = '10px';%0A
     
@@ -1483,34 +1483,32 @@
 th;%0A            
-  
 element%5B0%5D.style
@@ -1529,18 +1529,16 @@
 th.max(%0A
-  
         
@@ -1552,16 +1552,17 @@
 ath.min(
+(
 parent%5B0
@@ -1574,16 +1574,21 @@
 setWidth
+ - 6)
  * ratio
@@ -1610,34 +1610,32 @@
                 
-  
 parseFloat(maxFo
@@ -1634,34 +1634,32 @@
 at(maxFontSize)%0A
-  
               ),
@@ -1665,34 +1665,32 @@
 ,%0A              
-  
 parseFloat(minFo
@@ -1709,18 +1709,16 @@
         
- 
- 
 ) + 'px'
@@ -1733,17 +1733,12 @@
     
-  %7D,50)
+%7D
 ;%0A
+%0A
     
@@ -1747,19 +1747,53 @@
     
-%7D; resizer(
+$timeout( function() %7B resizer() %7D, loadDelay
 );%0A%0A

Fix min font size issues with wrapping