mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 09:35:37 -05:00
Modifying angular bootstrap to add injection at the module level (#1691)
* work on fixing injection * change bootstrapping method * add a catch for testing * remove unneeded code
This commit is contained in:
@@ -95,7 +95,6 @@ export class SingleQueryManagementService {
|
||||
*/
|
||||
@Injectable()
|
||||
export class CommonServiceInterface extends AngularDisposable {
|
||||
protected _uniqueSelector: string;
|
||||
protected _uri: string;
|
||||
|
||||
/* Special Services */
|
||||
@@ -115,6 +114,12 @@ export class CommonServiceInterface extends AngularDisposable {
|
||||
@Inject(IQueryManagementService) protected _queryManagementService: IQueryManagementService
|
||||
) {
|
||||
super();
|
||||
// during testing there may not be params
|
||||
if (this._params) {
|
||||
this.scopedContextKeyService = this._params.scopedContextService;
|
||||
this._connectionContextKey = this._params.connectionContextKey;
|
||||
this.uri = this._params.ownerUri;
|
||||
}
|
||||
}
|
||||
|
||||
public get metadataService(): SingleConnectionMetadataService {
|
||||
@@ -133,20 +138,6 @@ export class CommonServiceInterface extends AngularDisposable {
|
||||
return this._singleQueryManagementService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the selector for this instance, should only be set once
|
||||
*/
|
||||
public set selector(selector: string) {
|
||||
this._uniqueSelector = selector;
|
||||
this._getbootstrapParams();
|
||||
}
|
||||
|
||||
protected _getbootstrapParams(): void {
|
||||
this.scopedContextKeyService = this._params.scopedContextService;
|
||||
this._connectionContextKey = this._params.connectionContextKey;
|
||||
this.uri = this._params.ownerUri;
|
||||
}
|
||||
|
||||
protected setUri(uri: string) {
|
||||
this._uri = uri;
|
||||
this._singleMetadataService = new SingleConnectionMetadataService(this._metadataService, this._uri);
|
||||
|
||||
Reference in New Issue
Block a user