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

fix(docs-bootstrap): Removed injector from bootstrapped docs samples. #3458

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/components/angular-bootstrap/bootstrap-prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location',
embedRootScope.$destroy();
});

element.data('$injector', null);
angular.bootstrap(element, modules);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/jqLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ function JQLiteInheritedData(element, name, value) {
}

while (element.length) {
if (value = element.data(name)) return value;
if ((value = element.data(name)) !== undefined) return value;
element = element.parent();
}
}
Expand Down
14 changes: 14 additions & 0 deletions test/jqLiteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ describe('jqLite', function() {
dealoc(doc);
}
);

it('should return null values', function () {
var ul = jqLite('<ul><li><p><b>deep deep</b><p></li></ul>'),
li = ul.find('li'),
b = li.find('b');

ul.data('foo', 'bar');
li.data('foo', null);
expect(b.inheritedData('foo')).toBe(null);
expect(li.inheritedData('foo')).toBe(null);
expect(ul.inheritedData('foo')).toBe('bar');

dealoc(ul);
});
});


Expand Down
2 changes: 1 addition & 1 deletion test/testabilityPatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ afterEach(function() {
forEachSorted(cache, function(expando, key){
angular.forEach(expando.data, function(value, key){
count ++;
if (value.$element) {
if (value && value.$element) {
dump('LEAK', key, value.$id, sortedHtml(value.$element));
} else {
dump('LEAK', key, angular.toJson(value));
Expand Down