# "TriangleCreateTool is not a constructor" error while create custom annotation

**URL:** <https://pdfjs.community/t/trianglecreatetool-is-not-a-constructor-error-while-create-custom-annotation/231>\
**Category:** Technical Support\
**Created:** [August 27, 2020, 9:48am UTC](https://pdfjs.community/t/trianglecreatetool-is-not-a-constructor-error-while-create-custom-annotation/231 "2020-08-27T09:48:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maharoh9841](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/maharoh9841/32/88_2.png) [@maharoh9841](https://pdfjs.community/u/maharoh9841)\
**Post date:** [August 27, 2020, 9:48am UTC](https://pdfjs.community/t/trianglecreatetool-is-not-a-constructor-error-while-create-custom-annotation/231/1 "2020-08-27T09:48:32Z")

</div>

**Detailed description of issue**  
I get the following error while creating custom annotation while following this guide [https://pdfjs.express/documentation/annotation/custom-annotations](https://pdfjs.express/documentation/annotation/custom-annotations)  
I am using Angular 9 to load the WebViewer

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/eb2159c40f7cb201d1843979b8998c2ab4445eaa.png)

Can you please provide angular sample or guide for custom annotations if possible?

**Link to document**  
Here’s my config file for the custom annotation  
[myConfig.zip](https://pdfjs.community/uploads/short-url/pEZARezqGgxdRsu9GZN8CuDbjjh.zip) (1.1 KB)

**Code snippet**  
This is how I am calling the config file in my WebViewer  
WebViewer(  
{  
path: “…/lib/public”,  
config: “…/assets/myConfig.js”,  
},  
this.viewer.nativeElement  
);

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [September 10, 2020, 2:59pm UTC](https://pdfjs.community/t/trianglecreatetool-is-not-a-constructor-error-while-create-custom-annotation/231/2 "2020-09-10T14:59:30Z")

</div>

Hi!

Sorry for the delay here, I was on vacation when this was posted and it was missed.

When creating your triangle tool, make sure to use `function` syntax and not fat arrow syntax.

```javascript
const TriangleCreateTool = function() { ... }

```

There is an error in our documentation where we use an arrow function here instead. We will fix this ASAP.

Thanks,  
Logan
