Skip to content

Commit

Permalink
refactor(upgrade): remove unused parameters/properties/variables (#39965
Browse files Browse the repository at this point in the history
)

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

PR Close #39965
  • Loading branch information
gkalpak authored and mhevery committed Dec 8, 2020
1 parent 0969527 commit 166c783
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/upgrade/src/common/src/downgrade_component.ts
Expand Up @@ -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);
Expand Down
Expand Up @@ -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';
Expand All @@ -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();
}
Expand Down Expand Up @@ -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] = [];
Expand Down
3 changes: 1 addition & 2 deletions packages/upgrade/src/common/src/upgrade_helper.ts
Expand Up @@ -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);
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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(() => {
Expand Down

0 comments on commit 166c783

Please sign in to comment.