I stumbled upon an amazing example showcasing how to display a filetree using AngularJS: http://jsfiddle.net/n8dPm/
As I dive into the code, one particular section seems a bit confusing:
var compiledContents;
return function(scope, iElement, iAttr) {
if(!compiledContents) {
compiledContents = $compile(contents);
}
compiledContents(scope, function(clone, scope) {
iElement.append(clone);
});
To me, it appears that compiledContents is initially used for compiling contents, and then called as a function. Am I interpreting this correctly?
If anyone could shed some light on this, I would greatly appreciate it.