2

I have this ng-repeat section where i run a directive 'fittext' on p which make sure the text dosent overflow - if it does, fontsize gets decreased. And it works!

However, in IE it doesn't, i noticed from debugging that the style gets added too late. The directive sees nothing is overflowing AND THEN the div size changes which makes it overflow.

    <div ng-repeat="data in labelData" ng-style="{'height': chart.labelSize}">

      <div class="labelWrap" style="height: 100%;">

        <p fit-text>
          {{data.label}}
        </p>
      </div>
    </div>

How can i make sure the ng-style is added before my directive checks for overflow ?

Anders Pedersen
  • 2,255
  • 4
  • 25
  • 49
  • Not sure if it applies to your problem, but maybe ngCloak is what you're looking for: https://docs.angularjs.org/api/ng/directive/ngCloak ?? – chrisv Mar 02 '16 at 11:57

1 Answers1

3

There is a " missing right after horizontalLabelImageWrap.

Have you tried using $timeout(fn, 0) in your directive?

Maybe it helps:

Why is setTimeout(fn, 0) sometimes useful?

Community
  • 1
  • 1
b-pos465
  • 131
  • 4