Files
stf-DeviceFarmer/res/app/components/stf/common-ui/include-cached/include-cached-directive.js
Gunther Brunner 692582ce3d Finally fixed disappearing headers from dynamic columns.
Bind-once optimizations.
2014-06-23 14:32:27 +09:00

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)
})
}
}
}
}