I'm having trouble figuring out how to create a functional ui-sref
link from a translated string.
Using angular 1.4.9 along with angular translate 2.9.0
Below is the relevant code snippet
<div ng-bind-html="$scope.getTranslatedText(someObject)"></div>
controller {
function(value) {
this.$translate.isPostCompilingEnabled(); // Returns true
return this.$translate.instant("taskNames."+value.parameters['messageId'], value.parameters);
}
}
The translation contains the following string.
taskInstructions{
someMessageId: "Here is some text <a ui-sref=\"goSomewhere\">Some more text</a>"
}
The translation displays the text correctly, and without the ng-bind-html
the ui-sref link is visible. However, once the ng-bind-html
is added, the ui-sref disappears. I attempted to use compile, but it did not work as expected. I also tried using $sce.trustAsHtml
to display the ui-sref in the HTML output, but it did not create a functional link. It seems like I am overlooking a step somewhere, unsure of how to proceed in order for the ui-sref to work as intended.
Any advice on best practices to resolve this issue?