pass element and attributes to directive