I am a beginner at using Angular and have successfully implemented a filter to translate text for localization in my HTML view:
<input type="button" class="btn btn-link" value="{{'weeklyOrdersPage.reposting' | translate}}" ng-click="sortBy('reposting')" />
This filter retrieves text from a resource file and displays it, working perfectly.
Now, I want to achieve something similar in my controller where I am integrating a Google Map using the JavaScript API. I need to dynamically set the marker's text based on the selected language. I attempted this code which did not work as expected:
var markerContent = '<div class="infoWindowContent">' +
'<div><b>' + $filter('translate')("{{'weeklyOrdersPage.panelId'}}") + ': </b>' + panel.id + '</div>' +
'<div><b>' + $filter('translate')("{{'weeklyOrdersPage.panelClassification'}}") + ': </b>' + panel.panelClassification + '</div>' +
'<div><b>' + $filter('translate')('{{weeklyOrdersPage.quality}}') + ': </b>' + panel.format + '</div>'
'</div>';
Any suggestions on how to proceed?