You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.
Why custom handler function is invoked three times using translateas attribute and six times using translateas element (three for the element and three for the attribute)?
(I've also noticed that with translate 2.10.0 it happens 4 and 8 times)
Thanks,
Filippo
<!doctype html>
<html ng-app="myApp">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-translate/2.12.1/angular-translate.js"></script>
</head>
<body>
<div>
<p translate="test_id_1"></p>
<translate translate="test_id_2"></translate>
</div>
<script>
var translations = {};
var app = angular.module('myApp', ['pascalprecht.translate']);
app.config(['$translateProvider', function ($translateProvider) {
// add translation table
$translateProvider
.translations('en', translations)
.useMissingTranslationHandler('myCustomHandlerFactory')
}]);
app.factory('myCustomHandlerFactory', function () {
return function (translationID, uses) {
if (translationID == "test_id_1") {
console.log("handler per " + translationID);
return 'NO VALUE FOR test_id_1';
} else {
console.log("handler per " + translationID);
return 'NO VALUE FOR test_id_2';
}
};
});
</script>
</body>
</html>
The text was updated successfully, but these errors were encountered:
fmunafo
changed the title
"custom error Handler" invoked three or six times
"custom error Handler" invoked three times for each translate directive
Oct 19, 2016
Why custom handler function is invoked three times using
translate
as attribute and six times usingtranslate
as element (three for the element and three for the attribute)?(I've also noticed that with translate 2.10.0 it happens 4 and 8 times)
Thanks,
Filippo
The text was updated successfully, but these errors were encountered: