userhandles on typescript @types module

the @types/ej.web.all module does not have any of the methods/properties used to make userHandles in it, meaning when you compile it produces the following errors
ERROR in [at-loader] ./src/app/home/home.component.ts:282:13
    TS2346: Supplied parameters do not match any signature of call target.

ERROR in [at-loader] ./src/app/home/home.component.ts:294:41
    TS2339: Property 'ToolBase' does not exist on type 'typeof Diagram'.

ERROR in [at-loader] ./src/app/home/home.component.ts:297:64
    TS2339: Property 'UserHandle' does not exist on type 'typeof Diagram'.

for the following snippet:

@Component({
selector: 'ej-app',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css'],
encapsulation: ViewEncapsulation.None
})
export class HomeComponent {
selectedItems: object;
constructor() {
let self = this;
let AddConnectionTool = (function (base) {
ej.datavisualization.Diagram.extend(AddConnectionTool, base); //extend on does not accept two arguments on typing
function AddConnectionTool(name) {
base.call(this, name);
}
AddConnectionTool.prototype.mouseup = function(e) {
console.log("UserHandle Clicked");
};
return AddConnectionTool;
})(ej.datavisualization.Diagram.ToolBase); //ToolBase does not exist on typing

let userHandles = [];
let addConnectionHandle = ej.datavisualization.Diagram.UserHandle(); // UserHandle() does not exist on typing
addConnectionHandle.name = "Add Connection";
addConnectionHandle.tool = new AddConnectionTool(addConnectionHandle.name);
userHandles.push(addConnectionHandle);

this.selectedItems = { userHandles: userHandles };
}
}

You should also update the userHandle example here: https://help.syncfusion.com/angular-2/diagram/interaction#user-handles

to show the correct way to set userHandles on angular 2 like so:

<ej-diagram id="diagramCore" width="100%" height="100%" [selectedItems]="selectedItems" >
</ej-diagram>

rather than syncApp.controller(....) which you dont even give context for how to make anyway,


1 Reply

SG Shyam G Syncfusion Team April 28, 2017 11:57 AM UTC

Hi Matthew Meehan, 
 
We considered this “Userhandles not working in typescript” as an issue and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 
 
                                                                                                                                     
Regards, 
Shyam G 


Loader.
Up arrow icon