NGabriela

NGabriela

Member Since 8 years ago

Experience Points
2
follower
Lessons Completed
3
follow
Best Reply Awards
7
repos

3 contributions in the last year

Pinned
⚡ An Android List View implementation with support for drawable cells and many other swipe related features
⚡ A small collection of ADT templates to help quickly scaffold common Activity and UI patterns.
⚡ Ionic examples
⚡ Ionic examples
⚡ One framework. Mobile & desktop.
Activity
Nov
22
1 week ago
Activity icon
issue

NGabriela issue comment NorthwoodsSoftware/gojs-angular

NGabriela
NGabriela

Support for component method as callback to diagram events

Adding angular's component member function as callback to context menu button click is giving error

TypeError: `functionName` is not a function

The stackblitz example: https://stackblitz.com/edit/angular-gojs-family-tree

I have added two menu for explanation where first menu is working fine but the second one where callback method is used is not working.

I also tried to bind the callback to this context using

click: this.buttonCallback.bind(this)

But error is still there.

Same issue is being faced where external methods are being used to return some value to the diagram properties.

Ex.,

$(go.TextBlock, this.getStyle(), new go.Binding('text', 'name'));

private getStyle() {
   return {
        font: '700 12px Droid Serif, sans-serif',
        textAlign: 'center',
        margin: 10, maxSize: new go.Size(80, NaN)
   };
}
NGabriela
NGabriela

I fixed the issue by using initDiagram.bind(this). I am able to access any instance of my enclosing component inside initDiagram.