diff options
| author | Misko Hevery | 2012-04-17 13:55:10 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2012-04-20 11:29:34 -0700 | 
| commit | 94dd68570952f6f31abfa351b1159afcd3588a57 (patch) | |
| tree | dcc20e15f9a32f55d8b97dc67489cc6c3a116930 /src/ng/directive/script.js | |
| parent | dc32ea627e38b34ecdb709fce0cf34134d12193e (diff) | |
| download | angular.js-94dd68570952f6f31abfa351b1159afcd3588a57.tar.bz2 | |
fix(script): Incorrectly reading script text on ie
IE deals with script tags in special way and .text() does not work. Reading the .text property directly fixes the issue.
Diffstat (limited to 'src/ng/directive/script.js')
| -rw-r--r-- | src/ng/directive/script.js | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/src/ng/directive/script.js b/src/ng/directive/script.js index dcbd97b1..79f8b26e 100644 --- a/src/ng/directive/script.js +++ b/src/ng/directive/script.js @@ -35,8 +35,11 @@ var scriptDirective = ['$templateCache', function($templateCache) {      terminal: true,      compile: function(element, attr) {        if (attr.type == 'text/ng-template') { -        var templateUrl = attr.id; -        $templateCache.put(templateUrl, element.text()); +        var templateUrl = attr.id, +            // IE is not consistent, in scripts we have to read .text but in other nodes we have to read .textContent +            text = element[0].text; + +        $templateCache.put(templateUrl, text);        }      }    }; | 
