It’s not really Ionic related but it’s been driving me crazy for half a day already.
How can I access Angular Translate strings from inside my controller?
From what I can find in the docs, I could inject $translate and do something like $translate('AWESOME_STRING');
But I want to use three separate translations in, in my case, an alert: message, title and button label.
I read that $translate should return a promise which in turn I could use to do something like:
$q
.all([$translate('ALERT.TITLE'), $translate('ALERT.MESSAGE'), $translate('ALERT.BUTTON')])
.then(function (translations) {
// Array of translations can be used here in an alert
});
But that all ain’t working so far. What am I doing wrong? Does anyone have some experience with Angular Translate?