blob: b176907cd09ce4c0393dcd7f312e0c585f3e869b [file] [log] [blame]
module.exports = function includeCachedDirective(CompileCacheService) {
return {
restrict: 'ECA',
terminal: true,
compile: function(element, attrs) {
var srcExp = attrs.ngIncludeCached || attrs.src
return function(scope, element) {
var src = scope.$eval(srcExp)
var newScope = scope.$new()
CompileCacheService(src, newScope, function(compiledElm) {
element.append(compiledElm)
})
}
}
}
}