# Override FrontEnd methods

If you want to change the way a method works you can just use the same name as the parent, in case it is from inheritance.

Example:

**FormComponent.ts**

```typescript
@Component({
  template: ''
})
export class FormComponent extends ControlComponent {
    myMethod(): string {
        return "FormComponent";
    }
}
```

**MyComponent.ts**

```typescript
@Component({
   selector : "hello-world",
   styleUrls : ["./component.css"],
   templateUrl : "./component.html",
})
export class MyComponent extends FormComponent {
   myMethod(): string {
        return "MyComponent";
    }
}
```

In this case the **myMethod()** call will return "**MyComponent**".

We can also override components' native methods from our component, just access the component using the [<mark style="color:red;">ViewChild approach</mark>](/webmap/winforms/extend-or-modify-the-converted-application/access-frontend-components.md) and update the method you want.

```typescript
@ViewChild("button1")
button1: ButtonComponent;

ngAfterViewInit(): void {
  this.overrideButtonClick();
}

overrideButtonClick(): void {
  this.button1.click = (event: any) => {
    // new click logic
  }
}
```

Some of the native methods make calls to the [<mark style="color:red;">server</mark>](/webmap/general/frontend/documentation/winforms-angular-components/decorators/server-event.md), if you override them you will probably lose that functionality and other original behaviors, make sure to do it if strictly necessary and make sure to be adding the correct logic.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gapvelocity.ai/webmap/winforms/extend-or-modify-the-converted-application/override-frontend-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
