aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/compile.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng/compile.js')
-rw-r--r--src/ng/compile.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ng/compile.js b/src/ng/compile.js
index c059af47..82976822 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -274,9 +274,9 @@ function $CompileProvider($provide) {
this.$get = [
'$injector', '$interpolate', '$exceptionHandler', '$http', '$templateCache', '$parse',
- '$controller', '$rootScope', '$document', '$$urlUtils',
+ '$controller', '$rootScope', '$document', '$sce', '$$urlUtils',
function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse,
- $controller, $rootScope, $document, $$urlUtils) {
+ $controller, $rootScope, $document, $sce, $$urlUtils) {
var Attributes = function(element, attr) {
this.$$element = element;
@@ -1095,7 +1095,7 @@ function $CompileProvider($provide) {
$compileNode.html('');
- $http.get(templateUrl, {cache: $templateCache}).
+ $http.get($sce.getTrustedResourceUrl(templateUrl), {cache: $templateCache}).
success(function(content) {
var compileNode, tempTemplateAttrs, $template;
@@ -1203,12 +1203,12 @@ function $CompileProvider($provide) {
}
- function isTrustedContext(node, attrNormalizedName) {
+ function getTrustedContext(node, attrNormalizedName) {
// maction[xlink:href] can source SVG. It's not limited to <maction>.
if (attrNormalizedName == "xlinkHref" ||
(nodeName_(node) != "IMG" && (attrNormalizedName == "src" ||
attrNormalizedName == "ngSrc"))) {
- return true;
+ return $sce.RESOURCE_URL;
}
}
@@ -1238,7 +1238,7 @@ function $CompileProvider($provide) {
// we need to interpolate again, in case the attribute value has been updated
// (e.g. by another directive's compile function)
- interpolateFn = $interpolate(attr[name], true, isTrustedContext(node, name));
+ interpolateFn = $interpolate(attr[name], true, getTrustedContext(node, name));
// if attribute was updated so that there is no interpolation going on we don't want to
// register any observers