timeout

Posted on by Kim

setTimeout(() = > {
  this.valueField.nativeElement.focus();
}, 1);

Stop many call to backend

Posted on by Kim

private saveTimer;

saveSettings() {
  if(this.saveTimer) {
    clearTimeout(this.saveTimer);
  }
  this.saveTimer = setTimeout(() => {
    // Call service...   
    .....
  }, 500);
}

remove tracked files/folders from git

Posted on by Kim

Eg. remove target from git. Don't remove target just add it to .gitignore and run:


git rm -r --cached .
git add .
git commit -m ".gitignore fix"