21 lines
456 B
JavaScript
21 lines
456 B
JavaScript
angular.module("umbraco.directives").directive('archetypeLocalize', function (archetypeLocalizationService) {
|
|
var linker = function (scope, element, attrs){
|
|
|
|
var key = scope.key;
|
|
|
|
archetypeLocalizationService.localize(key).then(function(value){
|
|
if(value){
|
|
element.html(value);
|
|
}
|
|
});
|
|
}
|
|
|
|
return {
|
|
restrict: "E",
|
|
replace: true,
|
|
link: linker,
|
|
scope: {
|
|
key: '@'
|
|
}
|
|
}
|
|
}); |