add oncopy attribute to directive