From 00b18f98aae993d7c6423b88a807f87fb73f8072 Mon Sep 17 00:00:00 2001 From: "bret.ikehara" Date: Tue, 8 Sep 2015 14:31:24 -0700 Subject: [PATCH] feat(i18nAttr): Normalize the attribute key before it is set Normalize the attribute key before it is set. The attrs object will retain the camel case name while element attributes will be converted using snake case. Please refer to https://github.com/angular/angular.js/blob/v1.4.5/src/ng/compile.js#L1095-L1102. --- src/localization.directives.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/localization.directives.js b/src/localization.directives.js index 9543380..5d9f937 100644 --- a/src/localization.directives.js +++ b/src/localization.directives.js @@ -68,7 +68,7 @@ angular.module('ngLocalize') exp = values[key]; value = locale.getString(exp); if (lastValues[key] !== value) { - attrs.$set(key, lastValues[key] = value); + attrs.$set(attrs.$normalize(key), lastValues[key] = value); } } });