Skip to content

Commit edce7d9

Browse files
committed
Automate removing of configuration attributes and fix minor issue
1 parent 5839017 commit edce7d9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/igniteui-angular.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@
759759
!a.startsWith("data-") &&
760760
!a.startsWith("ng-") &&
761761
element.removeAttr) {
762-
element.removeAttr(a);
762+
element.removeAttr(a.replace(/([A-Z])/g, "-$1").toLowerCase());
763763
}
764764
}
765765

test/e2e/scenarios.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,14 @@ describe("my app", function() {
572572
//the other values should be preserved
573573
expect(util.getResult('$("#grid1 tbody tr:eq(1) td")[2].innerHTML'))
574574
.toBe(util.getResult('angular.element("#grid1").scope().northwind[1].UnitsOnOrder.toString()'));
575+
expect(util.getResult('$("#grid1").attr("width")'))
576+
.toBe(null);
577+
expect(util.getResult('$("#grid1").attr("height")'))
578+
.toBe(null);
579+
expect(util.getResult('$("#grid1").attr("auto-commit")'))
580+
.toBe(null);
581+
expect(util.getResult('$("#grid1").attr("primary-key")'))
582+
.toBe(null);
575583
});
576584

577585
it("should apply column template correctly", function () {

test/unit/directiveSpecs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe("Ignite directives", function() {
6161
}));
6262

6363
it("should create dialog", inject(function($compile, $rootScope) {
64-
var dialogTpl ='<ig-dialog id="dialog1" header-text="Foo" height="325px"><content>' +
64+
var dialogTpl ='<ig-dialog id="dialog1" header-text="Foo" height="325px" draggable="true"><content>' +
6565
'<p><img style="width: 220px" src="http://www.igniteui.com/images/samples/dialog-window/content.jpg" /></p><input style="margin: 5px" /></content>' +
6666
'</ig-dialog>';
6767
var dialog = angular.element('<div ng-app="my-app"><div ng-controller="NorthwindCtrl">' + dialogTpl + '</div>');
@@ -73,6 +73,8 @@ describe("Ignite directives", function() {
7373
expect(img.length).toBe(1);
7474
expect(dialogElement.length).toBe(1);
7575
expect(dialogElement.data("igDialog")).not.toBeUndefined();
76+
expect(dialogElement.attr("draggable")).toBeUndefined();
77+
expect(dialogElement.attr("height")).toBeUndefined();
7678
}));
7779

7880
it("should create dialog with nested controls", inject(function($compile, $rootScope) {

0 commit comments

Comments
 (0)