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:
Anthony Dresser
2018-06-22 16:09:13 -07:00
committed by GitHub
parent a627285a4c
commit 473ddfcdf1
11 changed files with 127 additions and 152 deletions

View File

@@ -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);