mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-09 19:48:00 -04:00
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:
@@ -8,8 +8,8 @@ import 'vs/css!sql/parts/grid/load/css/qp';
|
||||
import { ElementRef, Component, Inject, forwardRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import * as QP from 'html-query-plan';
|
||||
|
||||
import { IBootstrapService, BOOTSTRAP_SERVICE_ID } from 'sql/services/bootstrap/bootstrapService';
|
||||
import { QueryPlanParams } from 'sql/services/bootstrap/bootstrapParams';
|
||||
import { IBootstrapParams } from 'sql/services/bootstrap/bootstrapService';
|
||||
import { IQueryPlanParams } from 'sql/services/bootstrap/bootstrapParams';
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { registerThemingParticipant, ICssStyleCollector, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
@@ -32,7 +32,7 @@ export class QueryPlanComponent implements OnDestroy, OnInit {
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(BOOTSTRAP_SERVICE_ID) private _bootstrapService: IBootstrapService
|
||||
@Inject(IBootstrapParams) private _params: IQueryPlanParams
|
||||
) { }
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -40,9 +40,8 @@ export class QueryPlanComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
let parameters: QueryPlanParams = this._bootstrapService.getBootstrapParams(this._el.nativeElement.tagName);
|
||||
if (parameters) {
|
||||
this.planXml = parameters.planXml;
|
||||
if (this._params) {
|
||||
this.planXml = this._params.planXml;
|
||||
}
|
||||
this._disposables.push(registerThemingParticipant(this._updateTheme));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user