Closed BlackTango closed 5 years ago
@jonathanlassen check it out.. the module for angular.. if you would like to start coding on angular
Hi.. i have this working in demo.. i can even change and see on the screen.. check it out
https://github.com/jsGanttImproved/ng-gantt/blob/master/src/app/demo/demo.component.ts#L125
I.. have this workin on stackblitz as well.. check it out https://stackblitz.com/edit/angular-ng-gantt?file=src%2Fapp%2Fapp.component.ts
Hi, thank you for your reply. The stackblitz example have no options. When i try to add options and run this.editor.setOptions(this.editorOptions) an error appear.
ERROR TypeError: Cannot read property 'setOptions' of undefined
I think the editor is not initialised in ngOnInit().
I dont know what happent.. was not saved.. i saved the stackblitz againa
Thank you, it works. Really appreciated!
this.editor.setOptions(this.editorOptions)
Thanks for this line of code. This worked in subscribe method in angular. Whereas directly putting this.editorOptions in subscribe was not working. Why this.editorOptions doesn't work inside subscribe method? Also I think this is not mentioned in the documentation of ng-gantt
Uhmm maybe because you are changing a inner value for the editor? If you change the data variable or the editor var (this.editor = { ..} ) , this should trigger the rerender
The initial options are not loading correctly
This is in the html:
<ng-gantt [options]="editorOptions" [data]="gantt_projects" #editor></ng-gantt>
This is in the ts file:
editorOptions = { vShowRes: parseInt('0', 10), vTooltipDelay: 50, vScrollTo: "today", vShowStartDate: parseInt('0', 10), vShowEndDate: parseInt('0', 10), }
None of these options are actually working on startup. I need to manually run for it to work :
this.editor.setOptions(this.editorOptions)