LukaszWatroba / v-button

AngularJS pressable button with a busy indicator.
http://lukaszwatroba.github.io/v-button
MIT License
117 stars 21 forks source link

Handling dynamic values for vBusyLabel and the button text #1

Closed hthabet closed 9 years ago

hthabet commented 9 years ago

Hi @LukaszWatroba, I really like your directive. However it has a limit when we use dynamic values for the vBusyLabel attribute and idleLabelHtml. For instance, I use angluar-translate and my code using v-button directive will look like this :

<button class="btn" v-busy="auth.isBusy" v-busy-label="{{'auth.states.signin.signing_in' | translate}}"><span translate>auth.states.signin.signin_button</span></button>

In this case, when I change the translation locale, busyLabelHtml is never updated. Also, when the button is done being busy, idleLabelHtml returns what was in labelElement.html() (based on code below) which is in this case equal to _auth.states.signin.signinbutton and not the wanted translated text.


labelElement = angular.element(tElement.find('span'));

...

idleLabelHtml = labelElement.html(),

I already wrote a fix and I will be glad to submit a PR :)

LukaszWatroba commented 9 years ago

Thanks @hthabet. Go ahead, pull requests are always welcome :)

hthabet commented 9 years ago

@LukaszWatroba done!

LukaszWatroba commented 9 years ago

Merged. Thank you @hthabet