Jump to content
Search Community

Keaton88

Business
  • Posts

    6
  • Joined

  • Last visited

Community Answers

  1. Keaton88's post in Angular2 and greensock "this" reserved word was marked as the answer   
    I solved the problem.  Prior to calling the Draggable.create function, you reference the "this" keyword in a local variable like self.
    For example
    initDraggableItem_Characters() { let self = this; // references the angular 2 "this" Draggable.create('.itemDrag', { edgeResistance: 1, autoScroll: 1, liveSnap: false, throwProps: true, onPress: function () { this.activeCharacterType = self.getActiveCharacterType(this.target.id); // angular 2 function call this.startX = this.x; // greensock's this this.startY = this.y; // greensock's this .......
×
×
  • Create New...