diff options
| author | Vojta Jina | 2012-02-28 11:51:14 -0800 |
|---|---|---|
| committer | Vojta Jina | 2012-02-28 14:15:44 -0800 |
| commit | 4c1c50fd9bfafaa89cdc66dfde818a3f8f4b0c6b (patch) | |
| tree | d4b484531f01fae2a040780c275677be08e30166 /test/widgetsSpec.js | |
| parent | d1558d7924dec1156784f3b4576880f72213f671 (diff) | |
| download | angular.js-4c1c50fd9bfafaa89cdc66dfde818a3f8f4b0c6b.tar.bz2 | |
fix(directive.script): Do not compile content of script tags
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index fcd6fc04..6f0e3731 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -949,5 +949,23 @@ describe('widget', function() { expect($templateCache.get('/ignore')).toBeUndefined(); } )); + + + it('should not compile scripts', inject(function($compile, $templateCache, $rootScope) { + if (msie <=8) return; // see above + + var doc = jqLite('<div></div>'); + // jQuery is too smart and removes + doc[0].innerHTML = '<script type="text/javascript">some {{binding}}</script>' + + '<script type="text/ng-template" id="/some">other {{binding}}</script>'; + + $compile(doc)($rootScope); + $rootScope.$digest(); + + var scripts = doc.find('script'); + expect(scripts.eq(0).text()).toBe('some {{binding}}'); + expect(scripts.eq(1).text()).toBe('other {{binding}}'); + dealoc(doc); + })); }); }); |
