I solved the problem by replacing $ templateRequestService angular with a decorator.
See the sample code below:
module.config(["$provide", function ($provide) { $provide.decorator("$templateRequest", [ "$delegate", "$q", // DI specifications function ($delegate, $q) { // replace the delegate function $delegate = function (tpl) { var defer = $q.defer(); // convert the tpl from trustedvaluetoken to string if (typeof (tpl) !== "string" || !!$templateCache.get(tpl)) { tpl = $sce.getTrustedResourceUrl(tpl); } // make proxy call and resolve the promise; // Make an async call return defer.promise; } // return the modified delegate function return $delegate; }]); }]);
source share