moved form code from a controller to a directive