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

Commit 0b114fd

Browse files
committed
fix(docs-bootstrap): Removed injector from bootstrapped docs samples
This is necessary to make e2e tests pass for implementing #3411. At present, the docs are violating the rule being enforced by double-bootstrap prevention.
1 parent 61cb408 commit 0b114fd

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

docs/components/angular-bootstrap/bootstrap-prettify.js

+1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location',
241241
embedRootScope.$destroy();
242242
});
243243

244+
element.data('$injector', null);
244245
angular.bootstrap(element, modules);
245246
}
246247
};

src/jqLite.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ function JQLiteInheritedData(element, name, value) {
330330
}
331331

332332
while (element.length) {
333-
if (value = element.data(name)) return value;
333+
if ((value = element.data(name)) !== undefined) return value;
334334
element = element.parent();
335335
}
336336
}

test/jqLiteSpec.js

+14
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,20 @@ describe('jqLite', function() {
126126
dealoc(doc);
127127
}
128128
);
129+
130+
it('should return null values', function () {
131+
var ul = jqLite('<ul><li><p><b>deep deep</b><p></li></ul>'),
132+
li = ul.find('li'),
133+
b = li.find('b');
134+
135+
ul.data('foo', 'bar');
136+
li.data('foo', null);
137+
expect(b.inheritedData('foo')).toBe(null);
138+
expect(li.inheritedData('foo')).toBe(null);
139+
expect(ul.inheritedData('foo')).toBe('bar');
140+
141+
dealoc(ul);
142+
});
129143
});
130144

131145

test/testabilityPatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ afterEach(function() {
5656
forEachSorted(cache, function(expando, key){
5757
angular.forEach(expando.data, function(value, key){
5858
count ++;
59-
if (value.$element) {
59+
if (value && value.$element) {
6060
dump('LEAK', key, value.$id, sortedHtml(value.$element));
6161
} else {
6262
dump('LEAK', key, angular.toJson(value));

0 commit comments

Comments
 (0)