mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
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.
This commit is contained in:
parent
61cb4085d4
commit
0b114fd3e1
4 changed files with 17 additions and 2 deletions
|
|
@ -241,6 +241,7 @@ directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location',
|
|||
embedRootScope.$destroy();
|
||||
});
|
||||
|
||||
element.data('$injector', null);
|
||||
angular.bootstrap(element, modules);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue