Add directive option to inject arbitrary functions to treeitem scope