MCPcopy Create free account
hub / github.com/angular-ui/ui-router / getTrustedContext

Function getTrustedContext

test/angular/1.5/angular.js:9977–9994  ·  view source on GitHub ↗
(node, attrNormalizedName)

Source from the content-addressed store, hash-verified

9975
9976
9977 function getTrustedContext(node, attrNormalizedName) {
9978 if (attrNormalizedName === 'srcdoc') {
9979 return $sce.HTML;
9980 }
9981 var tag = nodeName_(node);
9982 // All tags with src attributes require a RESOURCE_URL value, except for
9983 // img and various html5 media tags.
9984 if (attrNormalizedName === 'src' || attrNormalizedName === 'ngSrc') {
9985 if (['img', 'video', 'audio', 'source', 'track'].indexOf(tag) === -1) {
9986 return $sce.RESOURCE_URL;
9987 }
9988 // maction[xlink:href] can source SVG. It's not limited to <maction>.
9989 } else if (attrNormalizedName === 'xlinkHref' ||
9990 (tag === 'form' && attrNormalizedName === 'action')
9991 ) {
9992 return $sce.RESOURCE_URL;
9993 }
9994 }
9995
9996
9997 function addAttrInterpolateDirective(node, directives, value, name, isNgAttr) {

Callers 1

Calls 1

nodeName_Function · 0.70

Tested by

no test coverage detected