diff --git a/example/src/app/gantt/gantt.component.ts b/example/src/app/gantt/gantt.component.ts index f5fd11bd..4c892402 100644 --- a/example/src/app/gantt/gantt.component.ts +++ b/example/src/app/gantt/gantt.component.ts @@ -8,11 +8,10 @@ import { GanttItem, GanttPrintService, NgxGanttComponent, - GanttSelectedEvent, - GanttLinkLineType + GanttSelectedEvent } from 'ngx-gantt'; import { of } from 'rxjs'; -import { delay } from 'rxjs/operators'; +import { delay, startWith } from 'rxjs/operators'; import { ThyNotifyService } from 'ngx-tethys/notify'; import { randomItems, random } from '../helper'; diff --git a/packages/gantt/src/gantt-upper.ts b/packages/gantt/src/gantt-upper.ts index 70b4544f..5cb9d10f 100644 --- a/packages/gantt/src/gantt-upper.ts +++ b/packages/gantt/src/gantt-upper.ts @@ -58,11 +58,11 @@ export abstract class GanttUpper { @Input() viewOptions: GanttViewOptions = {}; @Input() set linkOptions(options: GanttLinkOptions) { - this._linkOptions = Object.assign(options, this.config.linkOptions); + this._linkOptions = options; } get linkOptions() { - return this._linkOptions; + return Object.assign({}, defaultConfig.linkOptions, this.config.linkOptions, this._linkOptions); } @Input() disabledLoadOnScroll: boolean; diff --git a/packages/gantt/src/gantt.component.ts b/packages/gantt/src/gantt.component.ts index 7ccef54d..be804b12 100644 --- a/packages/gantt/src/gantt.component.ts +++ b/packages/gantt/src/gantt.component.ts @@ -29,8 +29,7 @@ import { coerceCssPixelValue } from '@angular/cdk/coercion'; import { NgxGanttTableComponent } from './table/gantt-table.component'; import { GANTT_ABSTRACT_TOKEN } from './gantt-abstract'; import { defaultColumnWidth } from './components/table/gantt-table.component'; -import { defaultConfig, GanttGlobalConfig, GANTT_GLOBAL_CONFIG } from './gantt.config'; -import { GanttLinkOptions } from './class/link'; +import { GanttGlobalConfig, GANTT_GLOBAL_CONFIG } from './gantt.config'; @Component({ selector: 'ngx-gantt', templateUrl: './gantt.component.html', @@ -84,7 +83,6 @@ export class NgxGanttComponent extends GanttUpper implements OnInit, AfterViewIn ngOnInit() { super.onInit(); - this.linkOptions = Object.assign({}, defaultConfig.linkOptions, this.config?.linkOptions, this.linkOptions); this.ngZone.onStable.pipe(take(1)).subscribe(() => { this.dragContainer.linkDragStarted.pipe(takeUntil(this.ngUnsubscribe$)).subscribe((event: GanttLinkDragEvent) => { this.linkDragStarted.emit(event);