refactor(upgrade): remove unused parameters/properties/variables (#39965)

This commit removes some unused parameters, properties and variables in
various `@angular/upgrade` functions.

PR Close #39965
This commit is contained in:
George Kalpakas 2020-12-07 19:55:34 +02:00 committed by Misko Hevery
parent e69288418c
commit 988b1e3506
4 changed files with 8 additions and 11 deletions

View File

@ -174,8 +174,8 @@ export function downgradeComponent(info: {
const injectorPromise = new ParentInjectorPromise(element);
const facade = new DowngradeComponentAdapter(
element, attrs, scope, ngModel, injector, $injector, $compile, $parse,
componentFactory, wrapCallback);
element, attrs, scope, ngModel, injector, $compile, $parse, componentFactory,
wrapCallback);
const projectableNodes = facade.compileContents();
facade.createComponent(projectableNodes);

View File

@ -8,7 +8,7 @@
import {ApplicationRef, ChangeDetectorRef, ComponentFactory, ComponentRef, EventEmitter, Injector, OnChanges, SimpleChange, SimpleChanges, StaticProvider, Testability, TestabilityRegistry, Type} from '@angular/core';
import {IAttributes, IAugmentedJQuery, ICompileService, IInjectorService, INgModelController, IParseService, IScope} from './angular1';
import {IAttributes, IAugmentedJQuery, ICompileService, INgModelController, IParseService, IScope} from './angular1';
import {PropertyBinding} from './component_info';
import {$SCOPE} from './constants';
import {getTypeName, hookupNgModel, strictEquals} from './util';
@ -33,8 +33,8 @@ export class DowngradeComponentAdapter {
constructor(
private element: IAugmentedJQuery, private attrs: IAttributes, private scope: IScope,
private ngModel: INgModelController, private parentInjector: Injector,
private $injector: IInjectorService, private $compile: ICompileService,
private $parse: IParseService, private componentFactory: ComponentFactory<any>,
private $compile: ICompileService, private $parse: IParseService,
private componentFactory: ComponentFactory<any>,
private wrapCallback: <T>(cb: () => T) => () => T) {
this.componentScope = scope.$new();
}
@ -250,7 +250,6 @@ export class DowngradeComponentAdapter {
*/
export function groupNodesBySelector(ngContentSelectors: string[], nodes: Node[]): Node[][] {
const projectableNodes: Node[][] = [];
let wildcardNgContentIndex: number;
for (let i = 0, ii = ngContentSelectors.length; i < ii; ++i) {
projectableNodes[i] = [];

View File

@ -41,8 +41,7 @@ export class UpgradeHelper {
private readonly $controller: IControllerService;
constructor(
private injector: Injector, private name: string, elementRef: ElementRef,
directive?: IDirective) {
injector: Injector, private name: string, elementRef: ElementRef, directive?: IDirective) {
this.$injector = injector.get($INJECTOR);
this.$compile = this.$injector.get($COMPILE);
this.$controller = this.$injector.get($CONTROLLER);

View File

@ -131,7 +131,6 @@ withEachNg1Version(() => {
let scope: angular.IScope; // mock
let ngModel = undefined as any;
let parentInjector: Injector; // testbed
let $injector = undefined as any;
let $compile = undefined as any;
let $parse = undefined as any;
let componentFactory: ComponentFactory<any>; // testbed
@ -166,8 +165,8 @@ withEachNg1Version(() => {
parentInjector = TestBed;
return new DowngradeComponentAdapter(
element, attrs, scope, ngModel, parentInjector, $injector, $compile, $parse,
componentFactory, wrapCallback);
element, attrs, scope, ngModel, parentInjector, $compile, $parse, componentFactory,
wrapCallback);
}
beforeEach(() => {