What's the best way to inject bound HTML in Polymer 2 - polymer-2.x

I need to display some bound HTML in my app.
In Polymer <0.8 there was injectBoundHTML, in 1 there was Polymer.Templatizer, but what is the best way in Polymer 2?

In Polymer 2 also, you can use Polymer.Templatizer.
Documentation can be found here: https://www.polymer-project.org/2.0/docs/api/namespaces/Polymer.Templatize.
There are few changes on code.

Related

How do I use Angular UI Grid (native to AngularJS) in an Angular 8 project

I am trying to use the Angular UI Grid in my Angular 8 project. Looking online i can't seem to find anywhere which tells me how to configure it properly.
I know that Angular UI grid is native to AngularJS. But is it possible to implement this into a TS project? I need the table in various different components.
Any help would be great!! :)
You can use ag-grid,mat-table,ngx-datatable instead of angular UI grid.

How to customize/ extend ootb components in spartacus

I am new to Spartacus and I am trying to add more elements to the component AddedToCartDialogComponent. Not sure how I can customise/extend this component.
I need to extend the typescript and also the template which is the view for this component.
Probably, your best bet is reading through the Spartacus docs about customizing components here. Also try to find your answer in other places in our docs.
If your question was about extending components from Angular perspective, you should probably first read Angular docs

How can I implement server side rendering (ssr) on the vuetify project that is 100% complete?

I had install my project vuetify with this reference : https://vuetifyjs.com/en/
My project has been 100% complete. Now I want to implement SSR for Search Engine Optimization (SEO)
I search on google and I find there exist 3 option to implement SSR to vuetify project
https://ssr.vuejs.org/
https://github.com/vuetifyjs/webpack-ssr
https://nuxtjs.org/
If I using option 2 or option 3, it seems I must to change my template. Maybe I should rewrite my code on the template. Because my template using vuetify template. I don't know if I choose option 1. Whether it also has to change my template or not. I must to try it first
What I want to ask is if in my position I have completed the 100% vuetify project, which is the best choice I should choose for SSR implementation?
Do I have to rewrite my code or is there another way to implement it?

Change class polymer 2.0

I am beginning to learn Polymer 2.0 and I am interested in learning ES6. My question is what is the way to transform this in polymer 2.0? I am just learning english.
Here is the link https://www.w3schools.com/jsref/tryit.aspfilename=tryjsref_element_classname.
For selecting an element inside the "light" DOM you can just us plain javascript
var el = document.getElementById('something');
console.log('Selected Element:', el);
<div id="something">some stuff</div>
For selection inside your polymer 2 shadow DOM you can use
this.$.something or for more complex queries this.shadowRoot.querySelector('div > p:first-child')

How to do two way binding in custom directives in Vue.js 2?

Hi I am looking for a solution for two way binding in Vue.js 2. I found a answer here about two way binding but it is in Vue.js 1. I tried to work it in Vue.js 1. But it didn't work. Can anyone help me here.
Why I want that?
A - I have a contenteditable div and a span tag inside which is shows a variable with v-html. But I want some functions to call when some edit happens. #change and #keyup don't work with span in vuejs 1. So I moved to custom directives.
To support something like this in vue2.0: as suggested by Evan You in forum here is to put these kind of functionality in a component and to reuse the same functionality on multiple components you can extract it into a shared mixin.
My suggestion is that the logic should be handled inside the component. In 2.0 v-model can work on components, e.g. https://github.com/vuejs/vue/blob/next/examples/select2/index.html
If you want to reuse the same logic on multiple components you can extract it into a shared mixin.