diff options
| author | Vojta Jina | 2012-02-28 14:43:37 -0800 |
|---|---|---|
| committer | Vojta Jina | 2012-02-28 17:41:30 -0800 |
| commit | d656d11489a0dbce0f549b20006052b215c4b500 (patch) | |
| tree | b64b201e9dea91cb6e201964525aae9c4d7308c7 /test | |
| parent | b37e8a2b141761d3211b52b8b6802c49c92d44f8 (diff) | |
| download | angular.js-d656d11489a0dbce0f549b20006052b215c4b500.tar.bz2 | |
feat(directive.style): Do not compile content of style element
Diffstat (limited to 'test')
| -rw-r--r-- | test/directivesSpec.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 88e70b50..c0533745 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -557,4 +557,28 @@ describe("directive", function() { expect(element.hasClass('bar')).toBe(true); })); }); + + + describe('style', function() { + + it('should not compile style element', inject(function($compile, $rootScope) { + element = jqLite('<style type="text/css">should {{notBound}}</style>'); + $compile(element)($rootScope); + $rootScope.$digest(); + + // read innerHTML and trim to pass on IE8 + expect(trim(element[0].innerHTML)).toBe('should {{notBound}}'); + })); + + + it('should compile content of element with style attr', inject(function($compile, $rootScope) { + element = jqLite('<div style="some">{{bind}}</div>'); + $compile(element)($rootScope); + $rootScope.$apply(function() { + $rootScope.bind = 'value'; + }); + + expect(element.text()).toBe('value'); + })); + }); }); |
