---
agentTools:
  projectIndex: https://angular2-tree.readme.io/llms.txt
---

# Calling API Methods

You can access the tree API by using the `treeModel` attribute on the element:

[block:api-header]
{
  "title": "Demo"
}
[/block]

[block:html]
{
  "html": "<iframe src=\"https://angular-tree-component.azurewebsites.net/#/api\" width=\"100%\" height=\"400px\"></iframe>\n"
}
[/block]

[block:html]
{
  "html": "<a href=\"https://github.com/CirclonGroup/angular-tree-component/blob/master/projects/example-app/src/app/api/api.component.ts\" target=\"_blank\">Source code for this demo</a>"
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "\t<tree-root #tree [nodes]=\"nodes\"></tree-root>\n\n  <button (click)=\"tree.treeModel.focusNextNode()\">next node</button>\n  <button (click)=\"tree.treeModel.focusPreviousNode()\">previous node</button>\n  <button (click)=\"tree.treeModel.focusDrillDown()\">drill down</button>\n  <button (click)=\"tree.treeModel.focusDrillUp()\">drill up</button>\n",
      "language": "html"
    }
  ]
}
[/block]

Or by accessing the treeNode that is passed through [Events](https://angular2-tree.readme.io/docs/events) or using [Action Mapping](https://angular2-tree.readme.io/docs/action-mapping).

You can find the complete API for TreeModel here:
[TreeModel](https://angular2-tree.readme.io/docs/treemodel)

And the complete API for TreeNode here:
[TreeNode](https://angular2-tree.readme.io/docs/api)