Cannot get RotatingTool to work properly in angular directive

I am having trouble creating an exact duplication of the custom rotating tool in an AngularJS directive.

The app runs as is, but if you uncomment line 40 it will crash the diagram.

On line 40 of index.html, I am unable to comment out this line without crashing the diagram. The issue may be in the line 256 in using the *.call(this) method.... not sure.