Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49188

Angular-translate and $ionicScrollDelegate.resize()

$
0
0

@Leffe108 wrote:

As angular-translate is async, I believe there will be cases where we want to have $ionicScrollDelegate.resize() being called when all strings on a page has been translated, so the scroll height is set up correctly.

Does anyone have a somewhat elegant solution on this when using the translate filter? Or does this has to be solved by having the controller lookup all strings and use a $q.all to wait on all promises and then call $ionicScrollDelegate.resize()?

I already made a pice of syntactic sugar for controller lookups so I can look up multiple strings like {'STR1': {p1: 'abc'}, 'STR2'} => '{'STR1': 'hello abc', 'STR2': 'have a nice day'} with a single promise that always resolves. It makes my controller code more simple. So maybe controller lookup in the view initialization is the way to go. But it still creates a bit extra code in the controller compared to the simple translate syntax in view files. But in the end it has to work and not just look good.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>