---
title: "Comment by Joe Smith on \"Creating custom form controls using Control Value Accessor in Angular\" | Hashnode"
description: "Hi. Great article. i was just wondering for the following \" this.onTouched(); // &lt;-- mark as touched this.selected = code; this.onChanged(code); // &lt;-- ca"
url: "https://hashnode.com/posts/custom-form-controls-controlvalueaccessor-in-angular/60ec556a573c235ee639cbf9/comment/66ab8ae9c1914e18cf47bcd0"
---

[Discussion](https://hashnode.com/posts/custom-form-controls-controlvalueaccessor-in-angular/60ec556a573c235ee639cbf9)

Comment [Creating custom form controls using Control Value Accessor in Angular](https://hashnode.com/posts/custom-form-controls-controlvalueaccessor-in-angular/60ec556a573c235ee639cbf9)

[Joe Smith](https://hashnode.com/@averageGuy)

[Aug 1, 2024](https://hashnode.com/posts/custom-form-controls-controlvalueaccessor-in-angular/60ec556a573c235ee639cbf9/comment/66ab8ae9c1914e18cf47bcd0)

Hi. Great article. i was just wondering for the following " this.onTouched(); // <-- mark as touched this.selected = code; this.onChanged(code); // <-- call function to let know of a change "

why does calling this.onTouched(); mark it as touched. is it not an empty function?

[Adithya Sreyaj](https://hashnode.com/@adisreyaj)

[Aug 1, 2024](https://hashnode.com/posts/custom-form-controls-controlvalueaccessor-in-angular/60ec556a573c235ee639cbf9/comment/66ab8ae9c1914e18cf47bcd0#reply-66abc3a1ef85411abe8e0014)

Angular actually gives you a reference to function in the `registerOnTouched()` callback. That function is wired up internally by Angular such that If we call the function, Angular will mark the form control as touched.

Ref: [v17.angular.io/api/forms/ControlValueAccessor](https://v17.angular.io/api/forms/ControlValueAccessor#registerontouched)

[Joe Smith](https://hashnode.com/@averageGuy)

[Aug 2, 2024](https://hashnode.com/posts/custom-form-controls-controlvalueaccessor-in-angular/60ec556a573c235ee639cbf9/comment/66ab8ae9c1914e18cf47bcd0#reply-66ac289cf1a2d34782cdb6ef)

[Adithya Sreyaj](https://hashnode.com/@adisreyaj) Thanks.
