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

dynamically call ng-fitText #43

Closed louisdoe closed 8 years ago

louisdoe commented 8 years ago

Hi

how to dynamically call ng-fitText to resize some text that has been dynamically insterted ?

thanks

louisdoe commented 8 years ago

Is it possible to "refresh" the action of ng-fitText please ?

patrickmarabeas commented 8 years ago

Could you create a demo (jsfiddle etc) to demonstrate the requirement / issue?

louisdoe commented 8 years ago

yes here it is: http://codepen.io/LouisDoe/pen/rxGQpZ

patrickmarabeas commented 8 years ago

http://codepen.io/anon/pen/wMrQRq

Have a look at the demo page in the repo for more examples.

patrickmarabeas commented 8 years ago

I see I spudded out when I added the dynamic stuff. ngModel instead of ngBind. Duhh.

louisdoe commented 8 years ago

Thanks a lot @patrickmarabeas, so the solution to my problem was to add data-ng-model="" to my element so it can dynamically resize.

louisdoe commented 8 years ago

@patrickmarabeas how should I do if there are several variable like this:

<div class="fittedRes" data-fittext data-fittext-max="12">
  {{computed.userLengthFtin}} x {{computed.userWidthFtin}} x {{computed.userThickFtin}}
</div>
patrickmarabeas commented 8 years ago

Exactly the same. data-ng-model="computed.userLengthFtin + ' x ' + ... "

louisdoe commented 8 years ago

ok perfect, thanks Patrick !