Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d30c214

Browse files
committed
fixup! feat($compile): add support for arbitrary property and event bindings
1 parent ea270d7 commit d30c214

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/ng/compile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,6 +2358,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
23582358
isNgProp = ngPrefixMatch[1] === 'Prop';
23592359
isNgEvent = ngPrefixMatch[1] === 'On';
23602360

2361+
// Normalize the non-prefixed name
23612362
name = name.replace(PREFIX_REGEXP, '')
23622363
.substr(4 + ngPrefixMatch[1].length).replace(/_(.)/g, function(match, letter) {
23632364
return letter.toUpperCase();
@@ -2381,6 +2382,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
23812382
}
23822383
} else {
23832384
// Update nName for cases where a prefix was removed
2385+
// NOTE: the .toLowerCase() is unnecessary and causes https://github.com/angular/angular.js/issues/16624
23842386
nName = directiveNormalize(name.toLowerCase());
23852387
attrsMap[nName] = name;
23862388

test/ng/compileSpec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12054,7 +12054,9 @@ describe('$compile', function() {
1205412054
expect(attrs.myCameltitle).toBe('56');
1205512055
expect(attrs.$attr.myCameltitle).toBe('my-camelTitle');
1205612056
expect(attrs.ngAttrMyCameltitle).toBeUndefined();
12057+
expect(attrs.ngAttrMyCamelTitle).toBeUndefined();
1205712058
expect(attrs.$attr.ngAttrMyCameltitle).toBeUndefined();
12059+
expect(attrs.$attr.ngAttrMyCamelTitle).toBeUndefined();
1205812060
});
1205912061
});
1206012062

0 commit comments

Comments
 (0)