page-modeller icon indicating copy to clipboard operation
page-modeller copied to clipboard

Allow to specify a unique property instead of ID

Open emerisier opened this issue 2 years ago • 1 comments

Very good tool, it would be perfect if we could tell the SPY to look at another unique property instead of the id

<input class="form-control ng-pristine ng-invalid ng-touched" formcontrolname="prenom" type="text" placeholder="Nom" style="null">

image

manual trick

  1. create id with the same value of formcontrolname
  2. after export i replace id by original property

elements = document.querySelectorAll('[formcontrolname]:not([id])') elements.forEach((item, index) => { value = item.getAttribute('formcontrolname') item.setAttribute('id', value) })

image

emerisier avatar Nov 07 '22 13:11 emerisier