-
Notifications
You must be signed in to change notification settings - Fork 6.7k
PaginationConfig should evaluate its attributes #1096
Comments
That's an angular-translate issue. You haven't setup the translation definitions for |
I have set up a plnkr that reproduces the problem: http://plnkr.co/edit/LgEI9Y?p=preview |
@frapontillo Indeed, |
Going to reopen this since it is a Bootstrap UI issue. |
Also, it looks like |
@frapontillo This has come up earlier once or twice and the answer was that changing these labels in runtime seemed like an edge case and we don't want penalize the performance of common use cases with some extra $watches. A workaround is to somehow destroy and recreate your Also there was an ugly bug in Angular that was just solved, that trying to update these attributes, as you suggest, would result in a lot added ugly code in our directive :-) For now and this issue, I would like to add the ability to re-evaluate the config object :-) |
Thank you for the detailed answer @bekos! |
@frapontillo If the directive is using I don't quite get the second question. Of course you can use this and you do use this as I can see. That's why |
Yes, but if you try and change the language (http://plnkr.co/edit/vVfX8J?p=preview), the expression is not re-evaluated (it does not turn into |
Attributes are not "observed" right now, because of the previous comment. |
Got it, I didn't get it was referred to attributes as well as |
Hi, |
+1 for this request |
After bce2505 has landed, both |
Hello , what was the solution to this problem ? i also had the same problem. |
+1 I want to dynamically translate the pagination labels too! Tried this but, as said, attributes are not re-evaluated.
|
@germanger The filter will be executed once when called and the result will be assigned to paginationConfig. (This is how Javascript works and not related to UI Bootstrap or AngularJS) What you should do instead, is listen to |
@realityking Thanks...Its done the job. var $translate = $filter('translate'); |
I'm really new to AngularJS but i have the same issue, someone can please make an example how you can use this solution?? |
@bandara00007 try your code but it is not working for me. Do you have sample code? |
@bandara00007 @railsstudent listenning at $translateChangeSuccess didn't work for me neither, I ended up using templateUrl, cloning current template in templateCache and replacing getText call with {{ 'label_first' | translate }} |
I am using the
pagination
directive withangular-translate
and I am having some issues trying to globally localize thepagination
directive. I am using the following code inapp.run
:But that doesn't work, as the shown values are simply
BACK
,NEXT
,FIRST
,LAST
. Is there a way to forcefully evaluate those properties when they change?Thanks.
The text was updated successfully, but these errors were encountered: