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

Commit

Permalink
fix(docs-bootstrap): Removed injector from bootstrapped docs samples
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeffbcross committed Aug 9, 2013
1 parent 61cb408 commit 0b114fd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
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;

This comment has been minimized.

Copy link
@dbinit

dbinit Aug 23, 2013

Contributor

@jeffbcross

Could this fix be cherry-picked into the 1.0 branch?

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

0 comments on commit 0b114fd

Please sign in to comment.