Skip to content

Commit

Permalink
first version fully working
Browse files Browse the repository at this point in the history
  • Loading branch information
mariohmol committed Nov 20, 2018
1 parent 16b551c commit 696a9c1
Show file tree
Hide file tree
Showing 8 changed files with 376 additions and 32 deletions.
2 changes: 1 addition & 1 deletion e2e/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('ng-packaged App', () => {
page.navigateTo();
page.getParagraphText()
.then(t => {
expect(t).toEqual('app works!');
expect(t).toEqual('Welcome to Angular Gantt - ng-gantt');
});
});
});
2 changes: 1 addition & 1 deletion ng-gantt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-gantt",
"version": "1.8.6",
"version": "1.8.7",
"license": "MIT",
"homepage": "https://github.com/mariohmol/ng-gantt",
"repository": {
Expand Down
10 changes: 6 additions & 4 deletions ng-gantt/src/gantt/gantt.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
Component, ElementRef, Input, OnInit, ViewChild
} from '@angular/core';
import { JSGantt } from 'jsgantt-improved';
// import { JSGantt } from 'jsgantt-improved';
import * as JSGantt from 'jsgantt-improved';
console.log(JSGantt);
@Component({
// tslint:disable-next-line:component-selector
Expand Down Expand Up @@ -38,7 +39,7 @@ export class GanttEditorComponent implements OnInit {
optionsBefore = this.editor.options;
}
// document.getElementById('embedded-Gantt')
const g = this.editor = new JSGantt.GanttChart(this.ganttEditorContainer.nativeElement, 'week');
const g = this.editor = new (<any>JSGantt).GanttChart(this.ganttEditorContainer.nativeElement, 'week');

if (g.getDivId() != null) {

Expand All @@ -56,9 +57,10 @@ export class GanttEditorComponent implements OnInit {
// Even with setUseSingleCell using Hour format on such a large chart can cause issues in some browsers
vFormatArr: ['Day', 'Week', 'Month', 'Quarter'],
});
if (this._data) {
if (this._data && this._data.forEach) {
this._data.forEach(row => {
g.AddItemObject(row);
row.pGantt = g;
g.AddTaskItemObject(row);
})
}
g.Draw();
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build:app": "npm run copy && ng build --project packages && rimraf src/ng-gantt",
"build:lib": "rimraf dist && ng-packagr -p ng-gantt/package.json",
"publish-npm": "npm run build:lib && cd dist/ng-gantt && npm publish",
"reload": "npm run build:lib && npm run build && npm run start",
"dev": "cd dist/app && http-server",
"test": "ng test",
"lint": "ng lint",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div style="text-align:center">
<h1>
Welcome to Angular Json Editor
Welcome to Angular Gantt - ng-gantt
</h1>
</div>
<router-outlet></router-outlet>
4 changes: 2 additions & 2 deletions src/app/demo/demo.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h3 *ngIf="editorOptions.language">Force Language to {{editorOptions.language}}<
<ng-gantt [options]="editorOptions" [data]="data" #editor></ng-gantt>
</div>

<h3>Multiple jsgantt</h3>
<!-- <h3>Multiple jsgantt</h3>
<div style="height:600px;">
<ng-gantt [options]="editorOptions" [data]="data2" #editorTwo></ng-gantt>
</div>
</div> -->
Loading

0 comments on commit 696a9c1

Please sign in to comment.