angular-elements

Angular Elements Polyfills to use in IE11 and Edge problems

若如初见. 提交于 2019-12-08 05:25:09
问题 Following on from my last post here, where I have an Angular elements project, which I can get working in Chrome if compile with TS target of es2015 , I have now gone back to compile with es5 (in preparation to try and get working in Edge and IE11). After the build to es5 , I combine the following output files const fs = require('fs-extra'); const concat = require('concat'); (async function build() { const files = [ './dist/angular-webcomponents-demo/runtime.js', './dist/angular-webcomponents

How to Compile Angular Element Into Web Component w/ Webpack or Angular CLI?

偶尔善良 提交于 2019-12-04 17:42:08
问题 I built a simple Web Component via Angular using Pascal Precht's tutorial, which you can see working HERE. It auto-magically compiles in the on Stackblitz in the link, but not locally. My end goal is to have the code for the resulting Web Component in a separate file locally. Eventually, I will upload it somewhere and pull it in via a single <script> tag, just like normal raw-html/javascript Web Components. I think the question speaks for itself, but you can read the details below if you

Angular Elements - pass a complicated input to my web component

余生长醉 提交于 2019-12-04 06:42:24
I started lately to play a little bit with angular elements that was released in angular V6, I opened a small sandbox project for that purpose. https://github.com/Slash7GNR/ndv-angular-elements Now I've tried to add a more complicated input to my web component - I've tried to add an array input as follows: in app.component.ts I've added: @Input() welcomeMessages: string[]; and in the template I've added: <div *ngFor="let message of welcomeMessages; let index = index"> {{index}} - {{message}} </div> Then, I've created a static html file and added the following code: (pls-wrk is a web component

Can I have angular library that emits Angular elements in single js file?

人走茶凉 提交于 2019-12-03 13:27:23
问题 I'm starting to get into the angular 6 bits, and am very interested in Angular Elements as well as the new library projects. I have an upcoming project that will probably need both these new features. I have the need to create custom UI components that are reusable across web frameworks, but I'd also like to have first class support for using them in angular projects. I've followed this tutorial and have an angular6 app that registers custom elements, and concats the webpack bundles in a

How to Compile Angular Element Into Web Component w/ Webpack or Angular CLI?

痴心易碎 提交于 2019-12-03 10:53:34
I built a simple Web Component via Angular using Pascal Precht's tutorial , which you can see working HERE . It auto-magically compiles in the on Stackblitz in the link, but not locally. My end goal is to have the code for the resulting Web Component in a separate file locally. Eventually, I will upload it somewhere and pull it in via a single <script> tag, just like normal raw-html/javascript Web Components. I think the question speaks for itself, but you can read the details below if you would like: Details : To summarize my code in the link above, I have a very basic component: import {

How to mix Angular Elements with the “ng g library” approach?

落花浮王杯 提交于 2019-12-03 05:47:28
问题 As you know, the "ng g library" approach helps us with the creation of libraries of reusable components. But what if I wanted those components to be compiled into web components... through the support of Angular Elements? Not only that but also that each component from the lib was to be compiled into its own folder or JS file. How to configure a dev environment that would allow me to achieve that? For example: If I create a Lib and add a custom component, I know that I can compile it,

How to mix Angular Elements with the “ng g library” approach?

久未见 提交于 2019-12-02 20:26:07
As you know, the "ng g library" approach helps us with the creation of libraries of reusable components. But what if I wanted those components to be compiled into web components... through the support of Angular Elements? Not only that but also that each component from the lib was to be compiled into its own folder or JS file. How to configure a dev environment that would allow me to achieve that? For example: If I create a Lib and add a custom component, I know that I can compile it, generating a series of folders, such as esm5, esm2015, fesm5, etc. Now, the question is: How can I add, let's