angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

ng-src inside <script> not working in 1.2.0-rc.3

Open sarath2 opened this issue 13 years ago • 4 comments

<script type="text/javascript" ng-src="{{test}}"></script>

Not working on rc3. But working well in rc1.

Also <link ng-href="{{test}}" rel="stylesheet"> work perfectly.

sarath2 avatar Oct 19 '13 16:10 sarath2

http://plnkr.co/edit/27omboaE6Iry2YYS2JYk?p=preview with the <img> tag it seems to be working correctly, but with the <script> tag, the $observe fn gets an uninterpolated value. I don't totally understand why that's happening. It's like the <script> tag isn't aware of its scope or something.

caitp avatar Oct 19 '13 23:10 caitp

~~I think this is related to #4524~~

petebacondarwin avatar Oct 23 '13 12:10 petebacondarwin

This is actually due to the script element directive: https://github.com/angular/angular.js/blob/master/src/ng/directive/script.js. This sets terminal to true and has a higher priority (0) than the "attribute interpolation" directive (-100): https://github.com/angular/angular.js/blob/master/src/ng/compile.js#L1384

petebacondarwin avatar Oct 23 '13 13:10 petebacondarwin

Introduced by @IgorMinar's commit https://github.com/angular/angular.js/commit/31f190d4d53921d32253ba80d9ebe57d6c1de82b

petebacondarwin avatar Oct 23 '13 13:10 petebacondarwin