Created
December 4, 2015 09:44
-
-
Save osv/37036d1b50d3fc3036fe to your computer and use it in GitHub Desktop.
ng-translate terms and condiutnion. Right way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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