diff options
| author | Jeff Cross | 2013-08-02 09:21:33 -0700 | 
|---|---|---|
| committer | Jeff Cross | 2013-08-09 10:19:41 -0700 | 
| commit | 0b114fd3e1ce4cc120663222f2dfb34ee5dbda4c (patch) | |
| tree | 1330fc8161d804d6c2ebffe6a76f8e0da3cb5cde | |
| parent | 61cb4085d421060edfb98d7eae0a43b615542843 (diff) | |
| download | angular.js-0b114fd3e1ce4cc120663222f2dfb34ee5dbda4c.tar.bz2 | |
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.
| -rw-r--r-- | docs/components/angular-bootstrap/bootstrap-prettify.js | 1 | ||||
| -rw-r--r-- | src/jqLite.js | 2 | ||||
| -rw-r--r-- | test/jqLiteSpec.js | 14 | ||||
| -rw-r--r-- | test/testabilityPatch.js | 2 | 
4 files changed, 17 insertions, 2 deletions
diff --git a/docs/components/angular-bootstrap/bootstrap-prettify.js b/docs/components/angular-bootstrap/bootstrap-prettify.js index b42c7c3a..9d8a7d23 100644 --- a/docs/components/angular-bootstrap/bootstrap-prettify.js +++ b/docs/components/angular-bootstrap/bootstrap-prettify.js @@ -241,6 +241,7 @@ directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location',          embedRootScope.$destroy();        }); +      element.data('$injector', null);        angular.bootstrap(element, modules);      }    }; diff --git a/src/jqLite.js b/src/jqLite.js index 6ac99987..4a52cba0 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -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();    }  } diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index abfad064..913e6192 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -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); +    });    }); diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 7b4fe0ec..514a5fdb 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -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));  | 
