refactor(angular): use arrow functions (#18910)

This commit is contained in:
Manu MA
2019-08-06 14:18:08 +02:00
committed by GitHub
parent 3a22105375
commit f94300cbb3
8 changed files with 24 additions and 24 deletions

View File

@ -72,7 +72,7 @@ const getClasses = (element: HTMLElement) => {
return classes;
};
function setClasses(element: HTMLElement, classes: string[]) {
const setClasses = (element: HTMLElement, classes: string[]) => {
const classList = element.classList;
classList.remove(
@ -84,8 +84,8 @@ function setClasses(element: HTMLElement, classes: string[]) {
'ion-pristine'
);
classList.add(...classes);
}
};
function startsWith(input: string, search: string): boolean {
const startsWith = (input: string, search: string): boolean => {
return input.substr(0, search.length) === search;
}
};

View File

@ -206,7 +206,7 @@ export class IonVirtualScroll {
}
}
function getElement(view: EmbeddedViewRef<VirtualContext>): HTMLElement {
const getElement = (view: EmbeddedViewRef<VirtualContext>): HTMLElement => {
const rootNodes = view.rootNodes;
for (let i = 0; i < rootNodes.length; i++) {
if (rootNodes[i].nodeType === 1) {
@ -214,7 +214,7 @@ function getElement(view: EmbeddedViewRef<VirtualContext>): HTMLElement {
}
}
throw new Error('virtual element was not created');
}
};
proxyInputs(IonVirtualScroll, [
'approxItemHeight',