Skip to content

Can not get access to class properties inside initialize function for custom element #2606

Answered by kumilingus
frenzymind asked this question in Q&A
Discussion options

You must be logged in to vote

You need to assign the values of the class properties inside the preinitialize method.

export class JointDevider extends dia.Element {

  imageSelector: string;
  
  preinitialize() {
    this.imageSelector = 'divider';
  }
}

For more info please see jashkenas/backbone#3560.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@frenzymind
Comment options

@kumilingus
Comment options

Answer selected by frenzymind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants