Adds onAttach triggerMethod.