# Accessing a Component Instance in the ts Part of an Angular Component

## Environment

<table>
    <tbody>
	    <tr>
	    	<td>Product</td>
	    	<td>Progress® Kendo UI® for Angular</td>
	    </tr>
    </tbody>
</table>

## Description

I am using `<kendo-pdf-export>` in the template of a component. How can I access the [`PDFExportComponent`](https://www.telerik.com/kendo-angular-ui/components/pdf-export/api/pdfexportcomponent) from within the `.ts` part of the Angular component?

## Solution

To achieve the desired scenario, use either of the following approaches:

* [By using the `@ViewChild` decorator](https://www.telerik.com/kendo-angular-ui/components/knowledge-base/access-component-instance#using-the-viewchild-decorator)
* [By using a template variable](https://www.telerik.com/kendo-angular-ui/components/knowledge-base/access-component-instance#using-a-template-variable)

### Using the ViewChild Decorator

To query the component from the template, use the Angular [`@ViewChild`](https://angular.dev/api/core/ViewChild) decorator:

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/knowledge-base/access-component-instance/view-child/source.txt)

### Using a Template Variable

To get a reference to the component and pass it as a function argument, use a [template variable](https://angular.dev/guide/templates/variables):

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/knowledge-base/access-component-instance/template-variable/source.txt)
