add edit state to the custom directive