Skip to content

Instantly share code, notes, and snippets.

@osv
Created December 4, 2015 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osv/37036d1b50d3fc3036fe to your computer and use it in GitHub Desktop.
Save osv/37036d1b50d3fc3036fe to your computer and use it in GitHub Desktop.
ng-translate terms and condiutnion. Right way
updateTC();
$scope.$watch('$translateLoadingEnd', defferedUpdateTC);
function updateTC(arg) {
$translate('frontend.links.terms_and_conditions').then(function(termsText) {
// state to terms
var href = $state.href('app.terms-and-conditions', {lang: $rootScope.currentLocale}),
urledTerms = '<a href="'+ href +'">' + termsText + '</a>';
$translate('activerecord.attributes.profile/user.terms_acceptance', {text: urledTerms}).then(function(label) {
$scope.label = label;
});
});
}
function defferedUpdateTC( ) {
$timeout(function() {
updateTC();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment