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

Commit c032255

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

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

test/ng/compileSpec.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12036,16 +12036,23 @@ describe('$compile', function() {
1203612036
}));
1203712037
});
1203812038
inject(function($compile, $rootScope) {
12039-
$compile('<div attr-exposer ng-attr-title="12" ng-attr-super-title="34">')($rootScope);
12039+
$compile('<div attr-exposer ng-attr-title="12" ng-attr-super-title="34" ng-attr-camel_title="56">')($rootScope);
1204012040
$rootScope.$apply();
12041+
1204112042
expect(attrs.title).toBe('12');
1204212043
expect(attrs.$attr.title).toBe('title');
1204312044
expect(attrs.ngAttrTitle).toBeUndefined();
1204412045
expect(attrs.$attr.ngAttrTitle).toBeUndefined();
12046+
1204512047
expect(attrs.superTitle).toBe('34');
1204612048
expect(attrs.$attr.superTitle).toBe('super-title');
1204712049
expect(attrs.ngAttrSuperTitle).toBeUndefined();
1204812050
expect(attrs.$attr.ngAttrSuperTitle).toBeUndefined();
12051+
12052+
expect(attrs.cameltitle).toBe('56');
12053+
expect(attrs.$attr.cameltitle).toBe('camelTitle');
12054+
expect(attrs.ngAttrCameltitle).toBeUndefined();
12055+
expect(attrs.$attr.ngAttrCameltitle).toBeUndefined();
1204912056
});
1205012057
})
1205112058

@@ -12303,12 +12310,23 @@ describe('$compile', function() {
1230312310
}));
1230412311
});
1230512312
inject(function($compile, $rootScope) {
12306-
$compile('<div attr-exposer ng-prop-title="42">')($rootScope);
12313+
$compile('<div attr-exposer ng-prop-title="12" ng-prop-super-title="34" ng-prop-camel_title="56">')($rootScope);
1230712314
$rootScope.$apply();
12315+
1230812316
expect(attrs.title).toBeUndefined();
1230912317
expect(attrs.$attr.title).toBeUndefined();
12310-
expect(attrs.ngPropTitle).toBe('42');
12318+
expect(attrs.ngPropTitle).toBe('12');
1231112319
expect(attrs.$attr.ngPropTitle).toBe('ng-prop-title');
12320+
12321+
expect(attrs.superTitle).toBeUndefined();
12322+
expect(attrs.$attr.superTitle).toBeUndefined();
12323+
expect(attrs.ngPropSuperTitle).toBe('34');
12324+
expect(attrs.$attr.ngPropSuperTitle).toBe('ng-prop-super-title');
12325+
12326+
expect(attrs.camelTitle).toBeUndefined();
12327+
expect(attrs.$attr.camelTitle).toBeUndefined();
12328+
expect(attrs.ngPropCamelTitle).toBe('56');
12329+
expect(attrs.$attr.ngPropCamelTitle).toBe('ng-prop-camel_title');
1231212330
});
1231312331
});
1231412332

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy