add pass function to directive example