Angular Individual Service Injection - Decouple bootstrap service (#1457)

* change services to be individually injected into angular

* messing around with injection

* change angular bootstrapping to factory style

* formatting

* formatting

* fix imports

* fix build errors

* fix testsw

* fix tests

* fix compile errors
This commit is contained in:
Anthony Dresser
2018-05-23 16:51:02 -07:00
committed by GitHub
parent cd0f9b71c5
commit 1359354387
68 changed files with 1011 additions and 1116 deletions

View File

@@ -7,16 +7,16 @@ import { Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, On
import { getContentHeight, getContentWidth } from 'vs/base/browser/dom';
import { Dimension } from 'vs/base/browser/builder';
import { Disposable } from 'vs/base/common/lifecycle';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IInsightsView, IInsightData } from 'sql/parts/dashboard/widgets/insights/interfaces';
import { Table } from 'sql/base/browser/ui/table/table';
import { TableDataView } from 'sql/base/browser/ui/table/tableDataView';
import { DragCellSelectionModel } from 'sql/base/browser/ui/table/plugins/dragCellSelectionModel.plugin';
import { attachTableStyler} from 'sql/common/theme/styler';
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
@Component({
template: '<span></span>'
template: ''
})
export default class TableInsight extends Disposable implements IInsightsView, OnInit {
private table: Table<any>;
@@ -26,7 +26,7 @@ export default class TableInsight extends Disposable implements IInsightsView, O
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) private _elementRef: ElementRef,
@Inject(forwardRef(() => CommonServiceInterface)) private _bootstrap: CommonServiceInterface,
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService
) {
super();
this._elementRef.nativeElement.className = 'slickgridContainer';
@@ -65,7 +65,7 @@ export default class TableInsight extends Disposable implements IInsightsView, O
if (!this.table) {
this.table = new Table(this._elementRef.nativeElement, this.dataView, this.columns, { showRowNumber: true });
this.table.setSelectionModel(new DragCellSelectionModel());
this._register(attachTableStyler(this.table, this._bootstrap.themeService));
this._register(attachTableStyler(this.table, this.themeService));
}
}
}