Is it possible to render a datalist using Angular Formly? - angular-formly

I am trying to use Angular Formly to render a datalist without success. With what I have, it renders the text input element but drops the datalist markup.
The JS Bin demonstrating the problem is at http://jsbin.com/vamalasiru/edit?html,js,output.
Any thoughts?

The answer is to wrap the template in a div being that the template manipulator will only use the first element in a template if there is not root element.
The JS Bin has been updated to show the working solution.

Related

How to find xpath of js rendered element for puppeteer

Im trying to interact with a js rendered page. Essentially this is a free widget from tradingview; however, the color of the lines is not something I can change. (yes there is an override, however, it only affects 1 line) I need to be able to change 2 lines.
Trading View Advanced Chart Widget Constructor
Can anyone tell me if this is possible with a puppeteer? How can I get XPath for an element which is generated by JS? View source and developer tools do not provide any xpaths to the elements.

parsing & wrapping HTML strings with React components

I am hitting an API endpoint, which returns the HTML for a blog post as a string. So lots of <p> tags, <img>, <span>, and <div> tags in the response string, with a non-inconsequential amount of element nesting.
in a react app, I want to parse this HTML string, and replace some of the HTML elements (images, paragraphs) with custom react components ( ie wrap an image tag in a lazy-load react component).
what is a good / clean way to do this? trying to parse HTML with regex seems to be an antipattern, and I'm not sure what other possible options there are. parse the string into traditional dom nodes, and then iterate through the collection?
currently I just render the html-as-string inside a react component using dangerouslySetInnerHTML.
What is a reliable, non-regex way to wrap html-as-a-string entities with React components, while maintaining the original order of the nodes (ie in a blog post)?
Take a look at this module and see if it can help you: (https://www.npmjs.com/package/html-to-react). Basically, you can:
Convert html string to React component nodes
Replace the Children of an Element

Insert Polymer elements and scripts in a .Jade file

I don't know how to insert Polymer tags and UI components to Jade file, how to render it, or how to add the necessary script on the site. Can you help me with that?
Load up webcomponents polyfills
script(src="bower_components/webcomponentsjs/webcomponents.js")
Import Polymer and the element you want to use.
link(rel="import" href="../bower_components/polymer/polymer.html")
link(rel="import" href="bower_components/paper-button/paper-button.html")
Then create instances of it in your jade template.
paper-button() flat button
paper-button(raised) raised button
paper-button(noink) No ripple effect

Extending SVGGElement using Polymer

I am trying to create a custom element that extends a SVGGlement. Here is the JSBin link to the code: http://jsbin.com/kovumoloda/2/edit?html,console,output
When I run the code, ready() isn't called and so aren't the contents of the Shadow DOM rendered.
I tried the same example without Polymer and it worked. Here is the JS Bin link http://jsbin.com/vihosojofi/1/edit?html,console,output
Is there anything I need to do differently to make this thing work with Polymer ?
Thanks !

Using SVG inside polymer element

I'm trying to use an SVG file with symbols, but it doesn't work inside a polymer element.
This is the code I use:
<svg class="icon-home"><use xlink:href="/images/icons.svg#icon-home"></use></svg>
It works perfectly fine in my index.html but just doesn't display the icon when used inside the polymer template.
If I take the contents of /images/icons.svg and put it directly in the polymer element it works. (I'm sure that the path is correct though)
Any idea on what could be the problem?
As a workaround I just created a <svg-icon> polymer element, that just inlines the contents of the .svg file. It works but it seems to me that it's more a workaround than a solution.

Resources