mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
18 lines
472 B
JavaScript
18 lines
472 B
JavaScript
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)
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|