patrickmarabeas / ng-FitText.js

An AngularJS directive for inflating web type.
http://patrickmarabeas.github.io/ng-FitText.js
MIT License
222 stars 61 forks source link

Doesn't work within ng-view #24

Closed robertfmurdock closed 8 years ago

robertfmurdock commented 9 years ago

I've been having trouble getting this to work tonight, and after some experiments I discovered that I get great results when using this everywhere BUT within an ng-view. That is to say, with identical elements and css text will resize correctly outside of an ng-view but incorrectly within one. The text will render at font-size 10 and doesn't seem to respond to any prompting, including it seemingly ignores the data-fittext-max and data-fittext-min attributes.

Sorry I don't have time tonight to whip up an example to illustrate what I'm seeing, just thought I'd drop off the intel.

aviadhahami commented 8 years ago

:+1: Having same issue

aviadhahami commented 8 years ago

@robertfmurdock I worked around this by using ng-model and inline binding. i.e :

<h1 data-ng-model="test" fittext>{{test}}</h1>

update: Only work after an update occurred (i.e input text box changed the mode)

full workaround:

      $timeout(function(){
        $scope.titles = {
          description : 'What is HackIDC?'
        };
      },50);

this way the update runs after the render so you force another one... not best solution yet does the job

patrickmarabeas commented 8 years ago

data-ng-model="test" should be data-ng-bind="test" with no need of {{test}}. Bit of a spud moment on my behalf there... v4.x will have the correct watcher and require proper attr usage.