angular/angular.js — pull request #4879 by caitp (2013-11-11 11:18:20+00:00)
Title: feat(sce): trust resourceUrls where url is in a $cache

Enables sce.getTrustedResourceUrl and sce.parseAsResourceUrl to optionally look up urls in a $cacheFactory-generated cache, primarily the $templateCache.

I'd like to discuss a few things here:

1. Are things in $cacheFactory caches really trusted? In my mind, they should be. But there may be things I'm missing.

2. How useful would this be for non-template resources? Would it be possible to make it more useful?

3. Is there something I'm missing where perhaps this isn't actually necessary at all? It seemed to be an issue on [plnkr.co](http://plnkr.co/edit/XEtC9UILh7vJ7R4LKrnU?p=preview), although I haven't tested it outside of here just yet.

If it gets merged, it would be a simple thing to modify ng-include and other similar $sce-using core directives to work with it. Or perhaps it might make more sense to enable this as the default behaviour. I'm interested in finding out.