shadow-dom

Polymer-AngularJS two-way data binding

二次信任 提交于 2019-12-01 11:18:01
I have some custom element created with Polymer . Let's call it x-input, and it looks like this: <polymer-element name="x-input" attributes="name"> <template> <input type="text" value={{name}}> <span>{{name}}</span> <br /> <input type="range" value={{age}} > <span>{{age}}</span> </template> </polymer-element> And I have this html I use Angular: <html ng-app="testApp"> <body ng-controller="AppCtrl"> <input id="outer_input" type="text" ng-model="kids[0].name" value={{kids[0].name}} /> <br /> <span>name: {{kids[0].name}} age: {{kids[0].age}}</span><br /> <x-input ng-repeat="kid in kids" name={

Creating a custom table row

吃可爱长大的小学妹 提交于 2019-12-01 10:22:33
问题 I am trying to create a custom table row but having difficulty getting it to behave properly. I've tried the two below methods and they give bizarre results. I realize that this is very easy to to without custom elements but this is a small example of a much larger project. What can I change to achieve the desired result? class customTableRow extends HTMLElement { constructor(){ super(); var shadow = this.attachShadow({mode: 'open'}); this.tableRow = document.createElement('tr'); var td =

Polymer-AngularJS two-way data binding

时光总嘲笑我的痴心妄想 提交于 2019-12-01 09:25:59
问题 I have some custom element created with Polymer. Let's call it x-input, and it looks like this: <polymer-element name="x-input" attributes="name"> <template> <input type="text" value={{name}}> <span>{{name}}</span> <br /> <input type="range" value={{age}} > <span>{{age}}</span> </template> </polymer-element> And I have this html I use Angular: <html ng-app="testApp"> <body ng-controller="AppCtrl"> <input id="outer_input" type="text" ng-model="kids[0].name" value={{kids[0].name}} /> <br />

Override Element.prototype.attachShadow using Chrome Extension

一笑奈何 提交于 2019-12-01 09:20:35
I need to access the DOM of a web component that has a closed Shadow DOM for some Selenium testing. I've read in several references that you can override Element.prototype.attachShadow on the document startup in order to change the Shadow from closed to open. In order to do this, I created a Chrome Extension. Below is my manifest.json : { "name": "SeleniumTesting", "description": "Extension to open closed Shadow DOM for selenium testing", "version": "1", "author": "SeleniumTesting", "manifest_version": 2, "permissions": ["downloads", "<all_urls>"], "content_scripts": [{ "matches": ["http:/

Analog of ngTransclude in Angular.Dart

痞子三分冷 提交于 2019-12-01 06:04:45
I'm trying to figure out how to make a component render its children. So I can compile: <my-component> <div id="child"></div> </my-component> into something like this: <div id="parent"> <!-- some component stuff --> <div id="child"></div> </div> Is there something like ngTransclude in Angular.Dart? James deBoer AngularDart uses Shadow DOM in place of ngTransclude. This is one of the ways we are pushing Angular into the browser with emerging web standards. Adding a <content> tag instead your component's template will cause the child element to be placed there. e.g. in your example <my-component

Shadow-Piercing descendant combinator, '/deep/' , including '::shadow' pseudo elements, are being deprecated so how do we pierce the Shadow DOM?

耗尽温柔 提交于 2019-12-01 04:26:26
Let's say we had some CSS code for something like an animated CSS loader that we want to use across all our web components which make use of the Shadow DOM. How do we re-use this CSS code if we are unable to pierce the Shadow DOM like it was possible with ::shadow and /deep/ ? We can't even add a <link /> within the shadow DOM so currently I am force to duplicate the code via multiple <style> tags. I would really like to know what the suggested best practices are for this type of use case. Thank you. Abhinav Rather than using <link /> , I'd suggest you to use css @imports inside shadow root to

Analog of ngTransclude in Angular.Dart

此生再无相见时 提交于 2019-12-01 04:00:05
问题 I'm trying to figure out how to make a component render its children. So I can compile: <my-component> <div id="child"></div> </my-component> into something like this: <div id="parent"> <!-- some component stuff --> <div id="child"></div> </div> Is there something like ngTransclude in Angular.Dart? 回答1: AngularDart uses Shadow DOM in place of ngTransclude. This is one of the ways we are pushing Angular into the browser with emerging web standards. Adding a <content> tag instead your component

Shadow-Piercing descendant combinator, '/deep/' , including '::shadow' pseudo elements, are being deprecated so how do we pierce the Shadow DOM?

*爱你&永不变心* 提交于 2019-12-01 02:27:25
问题 Let's say we had some CSS code for something like an animated CSS loader that we want to use across all our web components which make use of the Shadow DOM. How do we re-use this CSS code if we are unable to pierce the Shadow DOM like it was possible with ::shadow and /deep/ ? We can't even add a <link /> within the shadow DOM so currently I am force to duplicate the code via multiple <style> tags. I would really like to know what the suggested best practices are for this type of use case.

Using jQuery with shadow dom

别来无恙 提交于 2019-12-01 00:32:11
Here I have created elements with shadow dom. /* some preparing code */ this.createShadowRoot(); // creates shadow root, this refers to element Later in the code I would access the shadow dom that I have created. These work: this.shadowRoot.getElementById("...") this.shadowRoot.querySelector("...") However this does not: $("...", this.shadowRoot) Why is that? As a temporary solution t his works at the moment : $("...", this.shadowRoot.children) Is there a better/more elegant way to work with the shadow root using jQuery? Note that the version of jQuery I'm using is 2.1.1 and I'm only dealing

Importing styles into a web component

纵然是瞬间 提交于 2019-11-30 20:09:43
What is the canonical way to import styles into a web component? The following gives me an error HTML element <link> is ignored in shadow tree : <template> <link rel="style" href="foo.css" /> <h1>foo</h1> </template> I am inserting this using shadow DOM using the following: var importDoc, navBarProto; importDoc = document.currentScript.ownerDocument; navBarProto = Object.create(HTMLElement.prototype); navBarProto.createdCallback = function() { var template, templateClone, shadow; template = importDoc.querySelector('template'); templateClone = document.importNode(template.content, true); shadow