import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class WaitForDomService {

  selectorString = ""
  constructor() { }

  selector({ selector, callback }) {
    
    function _try() {
      if (!document.querySelector(selector)) {
        window.requestAnimationFrame(_try);
      } else {
        callback()
      }
    };

    _try()

  }
}
