refactor(core): Removed readonly getters and changed to readonly (#19842)
variables PR Close #19842
This commit is contained in:
@ -66,13 +66,20 @@ export class CodegenComponentFactoryResolver implements ComponentFactoryResolver
|
||||
}
|
||||
|
||||
export class ComponentFactoryBoundToModule<C> extends ComponentFactory<C> {
|
||||
constructor(private factory: ComponentFactory<C>, private ngModule: NgModuleRef<any>) { super(); }
|
||||
readonly selector: string;
|
||||
readonly componentType: Type<any>;
|
||||
readonly ngContentSelectors: string[];
|
||||
readonly inputs: {propName: string, templateName: string}[];
|
||||
readonly outputs: {propName: string, templateName: string}[];
|
||||
|
||||
get selector() { return this.factory.selector; }
|
||||
get componentType() { return this.factory.componentType; }
|
||||
get ngContentSelectors() { return this.factory.ngContentSelectors; }
|
||||
get inputs() { return this.factory.inputs; }
|
||||
get outputs() { return this.factory.outputs; }
|
||||
constructor(private factory: ComponentFactory<C>, private ngModule: NgModuleRef<any>) {
|
||||
super();
|
||||
this.selector = factory.selector;
|
||||
this.componentType = factory.componentType;
|
||||
this.ngContentSelectors = factory.ngContentSelectors;
|
||||
this.inputs = factory.inputs;
|
||||
this.outputs = factory.outputs;
|
||||
}
|
||||
|
||||
create(
|
||||
injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,
|
||||
|
@ -41,9 +41,9 @@ export class QueryList<T>/* implements Iterable<T> */ {
|
||||
private _results: Array<T> = [];
|
||||
public readonly changes: Observable<any> = new EventEmitter();
|
||||
|
||||
get length(): number { return this._results.length; }
|
||||
get first(): T { return this._results[0]; }
|
||||
get last(): T { return this._results[this.length - 1]; }
|
||||
readonly length: number;
|
||||
readonly first: T;
|
||||
readonly last: T;
|
||||
|
||||
/**
|
||||
* See
|
||||
@ -98,6 +98,9 @@ export class QueryList<T>/* implements Iterable<T> */ {
|
||||
reset(res: Array<T|any[]>): void {
|
||||
this._results = flatten(res);
|
||||
(this as{dirty: boolean}).dirty = false;
|
||||
(this as{length: number}).length = this._results.length;
|
||||
(this as{last: T}).last = this._results[this.length - 1];
|
||||
(this as{first: T}).first = this._results[0];
|
||||
}
|
||||
|
||||
notifyOnChanges(): void { (this.changes as EventEmitter<any>).emit(this); }
|
||||
|
Reference in New Issue
Block a user