# Programmatic Control

The [`PopoverAnchor`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popoveranchordirective) and the [`PopoverContainer`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popovercontainerdirective) directives allow you to programmatically control their corresponding popovers.

## PopoverAnchor Programmatic Control

The [`PopoverAnchor`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popoveranchordirective) directive exposes the following API methods to enable programmatic popover control:

* [`show`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popoveranchordirective#show)—Displays the popover associated with the anchor.
* [`hide`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popoveranchordirective#hide)—Hides the popover associated with the anchor, if it is currently displayed.
* [`toggle`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popoveranchordirective#toggle)—Toggles the popover associated with the anchor.

> To control the visibility of the Popover only programmatically, set the [`showOn`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popoveranchordirective#showon) option of the `PopoverAnchor` to `none`.

The following example demonstrates the PopoverAnchor methods in action.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/tooltips/popover/methods-anchor/source.txt)

## PopoverContainer Programmatic Control

The [`PopoverContainer`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popovercontainerdirective) directive exposes the following API methods to enable programmatic popover control:

* [`show`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popovercontainerdirective#show)—Displays the popover associated with the container. The `show` method accepts as a parameter, the specific element inside the container, to be used as a popover anchor.
* [`hide`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popovercontainerdirective#hide)—Hides the popover, if it is currently displayed on any anchor inside the container.
* [`toggle`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popovercontainerdirective#toggle)—Toggles the popover. The `toggle` method takes as a parameter, the specific element inside the container, to be used as a popover anchor.

> To control the visibility of the Popover only programmatically, set the [`showOn`](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popovercontainerdirective#showon) option of the `PopoverContainer` to `none`.

The following example demonstrates the PopoverContainer methods in action.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/tooltips/popover/methods-container/source.txt)

## Suggested Links

* [API Reference of the Popover](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popovercomponent)
* [API Reference of the PopoverAnchor](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popoveranchordirective)
* [API Reference of the PopoverContainer](https://www.telerik.com/kendo-angular-ui-develop/components/tooltips/api/popovercontainerdirective)
