element array instead of node list

This commit is contained in:
Kyle Spearrin 2018-06-05 13:28:09 -04:00
parent 22c12cf5c4
commit 66b3dbae17
1 changed files with 2 additions and 2 deletions

View File

@ -10,14 +10,14 @@ import {
})
export class BoxRowDirective implements OnInit {
el: HTMLElement = null;
formEls: NodeListOf<Element>;
formEls: Element[];
constructor(private elRef: ElementRef) {
this.el = elRef.nativeElement;
}
ngOnInit(): void {
this.formEls = this.el.querySelectorAll('input:not([type="hidden"]), select, textarea');
this.formEls = Array.from(this.el.querySelectorAll('input:not([type="hidden"]), select, textarea'));
this.formEls.forEach((formEl) => {
formEl.addEventListener('focus', (event: Event) => {
this.el.classList.add('active');