0

I am trying to reach/read some elements, which are inside a shadow-root, in my case a form tag. The HTML structure of the web-component seems like this:

<web-comp>
  <h1>Titel</h1>
  #shadow-root (open)
     <form>
         ...
     </form>
</web-comp>

Inside the Angular directive's link function i have sth. like:

link: function ($scope, el) {
  var myWebComponent = el.find("web-comp");  // it finds it
  var titel = myWebComponent.find("h1");     // it finds it too

  myWebComponent.find("form");          // does not find it
  myWebComponent.find("shadowRoot");    // does not find it
  myWebComponent.find("#shadowRoot");   // does not find it
  myWebComponent.find("#shadow-root");  // does not find it
  myWebComponent.shadowRoot;            // does not find it
  myWebComponent.#shadowRoot;           // does not find it
}

Is there a way to reach to form tag inside the shadowRoot?

akcasoy
  • 6,497
  • 13
  • 56
  • 100
  • 1
    PD - https://stackoverflow.com/questions/16633057/is-it-possible-to-access-shadow-dom-elements-through-the-parent-document – Ponpon32 Aug 06 '19 at 06:48
  • thanks, but my question is about JQLite.. – akcasoy Aug 06 '19 at 06:51
  • The [jqLite](https://docs.angularjs.org/api/ng/function/angular.element#angularjs-s-jqlite) `.find` method is limited to lookups by tag name. – georgeawg Aug 06 '19 at 21:43
  • @georgeawg if you know that it is not possible with jqlite, you can write that also as an answer.. – akcasoy Aug 07 '19 at 05:51

0 Answers0