Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit a6c540e

Browse files
jonbcardpkozlowski-opensource
authored andcommitted
fix(dialog): IE8 fix to not set data() against text nodes
Closes #328
1 parent 661c303 commit a6c540e

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/dialog/dialog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ dialogModule.provider("$dialog", function(){
123123

124124
if (self.options.controller) {
125125
var ctrl = $controller(self.options.controller, locals);
126-
self.modalEl.contents().data('ngControllerController', ctrl);
126+
self.modalEl.children().data('ngControllerController', ctrl);
127127
}
128128

129129
$compile(self.modalEl)($scope);

src/dialog/test/dialog.spec.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe('Given ui.bootstrap.dialog', function(){
22

33
var $document, $compile, $scope, $rootScope, $dialog, q, provider;
4-
var template = '<div>I\'m a template</div>';
4+
var template = '<div>I\'m a template</div> ';
55

66
beforeEach(module('ui.bootstrap.dialog'));
77
beforeEach(module('template/dialog/message.html'));
@@ -287,4 +287,22 @@ describe('Given ui.bootstrap.dialog', function(){
287287
expect($document.find('body > div.modal > div.modal-header').length).toBe(1);
288288
});
289289
});
290+
291+
describe('when opening it with a template containing white-space', function(){
292+
293+
var controllerIsCreated;
294+
function Controller($scope, dialog){
295+
controllerIsCreated = true;
296+
}
297+
298+
beforeEach(function(){
299+
createDialog({
300+
template:' <div>Has whitespace that IE8 does not like assigning data() to</div> ',
301+
controller: Controller
302+
});
303+
openDialog();
304+
});
305+
306+
dialogShouldBeOpen();
307+
});
290308
});

0 commit comments

Comments
 (0)