309 questions
2
votes
1
answer
64
views
How to pass an object programmatically to an Angular custom element (@angular/elements)?
I’m trying to pass an object as an input to an Angular custom element created with @angular/elements, not via HTML attributes (since setAttribute only supports strings).
Here’s a minimal example:
...
2
votes
1
answer
52
views
Angular Elements – setting `@Input()` property programmatically doesn’t update component
I’m experimenting with Angular Elements and trying to update an input property programmatically, not by writing it in HTML like <app-foo name="...">.
Here’s a minimal example:
import {
...
3
votes
1
answer
207
views
Angular elements: ng build in Angular 18 with --optimization=true emits broken artifacts
when I try to build the module with the flag --optimization equal to false, then everything works just fine. The compilation finishes without any issues and I can use my web-component as well. Once I ...
1
vote
1
answer
61
views
@HostListener doesn't work in a complicated page
I have many Angular components; They all have a method with @HostListener
And I converted them into web components on @angular/elements and embedded them in some legacy JSP/JSF pages.
This approach ...
0
votes
0
answers
56
views
Angular `NG0203 Error` for `StandAloneInjector` on trying to embed custom element into view container
Details:
I have two completely separate Angular applications. One is like parent one and other one is child.
Child should be exported as js module, loaded by parent app and embedded into some ...
1
vote
1
answer
357
views
Strange behavior using Angular elements with application builder v19
I created a demo app using the @angular/elements package (v19) to build an mfe-1 app as a web component, which is then displayed inside another app called shell. Both apps are set up with the Angular ...
0
votes
0
answers
147
views
Issue with external styles in custom elements after upgrading to Angular 19
Recently I upgraded my project with NX to Angular 19 and encountered an issue with custom elements.
I have 2 apps in my NX monorepo:
App with custom element (Widget);
Playground where the widget is ...
2
votes
1
answer
44
views
Angular WebComponent instances is getting created multiple times
I have created a webcomponent using angularElements createElement. I am using this webcomponent in different angular application.
Whenever user moves to the view which has webcomponent an instance of ...
0
votes
1
answer
177
views
Add angular material to an angular elements based microfrontend
I have an angular webcomponent that I build with the help of @angular/elements.
The webcomponent has been working in my website for months, so most of the code, deployment and loading is ok.
The ...
5
votes
4
answers
6k
views
How to properly manage a boolean signal input in a custom Angular element (v19)?
I have a web component created with Angular 19 prerelease version. It has a liked signal input, which can be set from a parent but can't be modified from within because signal inputs are read only. To ...
1
vote
1
answer
203
views
Consuming an Angular Element (Ang 18) in AngularJS getting 404 error
I am trying to do an Angular upgrade slowly, last resort, by having Angular 18 "angular elements" (web components) using those Angular 18 web components inside an AngularJS (1.8.3) site. ...
1
vote
2
answers
1k
views
Angular library gives me injection errors with HttpClient
I am trying to build a simple library in Angular (version 18) that can be used in my application and Angular Elements component.
The idea is simple in both the application and element: Get the same ...
5
votes
1
answer
707
views
Angular 18+ Elements bundled as Web components
I have the following question about taking direction to build a web application separated into a micro-front-end app. For this purpose, I'm using Angular Elements. I'm reading the official ...
0
votes
1
answer
59
views
Angular TemplateRef in web component
If we create a webcomponent in Angular, how to consume Input that takes TemplateRef?
For example the following component ist converted to a web component
@component({
selector:"app-lorem",
.....
0
votes
1
answer
670
views
Web Components and Angular 18
What are the Changes form Angular 17 to 18 for Web Components (Standalone Elements)?
I've tried some Angular 17 related Guides / couldn't find any (usefull) information about the changes for 18 so far....
1
vote
1
answer
65
views
Angular Elements Overwrites Multiple Instances on the Same Page
I'm using Angular Elements within a WordPress site to show the same component with different attributes on the same page. While the components render correctly when placed on different pages, they ...
3
votes
0
answers
416
views
Angular Elements web component is throwing a zone.js error: "emitter.pipe is not a function"
I have created an Angular Elements web component to be used as a micro-frontend in an existing Vue application. The project requires the custom web component be in Angular and the main application be ...
1
vote
1
answer
1k
views
How simply remove hash from chunk in Angular with esbuild
After updating Angular to version 17 with esbuild, a hash is added to the chunk name.
The problem is that if you want to use lazy loading for Angular-elements, then in development mode a hash will be ...
2
votes
0
answers
131
views
How do I add an Angular v.17 Elements component to an ASP.Net webforms app?
I have an ASP.Net Webforms app running .Net 4.5.
I've built an Angular v.17 app with Angular Elements and an Angular Materials Table following this tutorial as a model of the Angular Elements portion: ...
0
votes
0
answers
286
views
Accessing main.js file from 1 angular app exporting angular element into a container angular app
`I have 2 angular applications running on localhost:4200 and localhost:4201.
In localhost:4200, I have converted the complete AppComponent into an angular element .
I have built the project, ...
5
votes
2
answers
9k
views
Custom Element in Angular 17
since I updated Angular to version 17 I can't create web components..
I used to do it in app.module, where are they created now?
I tried in app.component as the guide says but it doesn't seem to work.....
2
votes
1
answer
1k
views
Angular 17 Universal (SSR) + Standalone components + WebComponents (Angular elements)
It is possible to create an Angular 17 universal project with standalone components that also have web components (Angular elements)?
I'm trying to import a component (regular one) from an Angular 16 ...
0
votes
0
answers
28
views
angularjs element manipulation
I am confused about angularjs manipulation.
How come:
angular.element("#elementID").is(':visible') ; // works
angular.element("#elementID").slideUp() ; // works
...
0
votes
0
answers
227
views
Is it possibile to export an entire Angular application as web component?
This is a theoric question.
I know I can export an Angular component as a web component with Angular Element.
My question is: can I export and existing entire Angular Application as a web component ...
0
votes
0
answers
155
views
what are disadvantage of using angular elements
Our application is build on .net MVC using cshtl view, we are planning to migrate it into angular. For this we want to use angular element so that it can be easily mixed with cshtml pages. We would ...
1
vote
1
answer
793
views
Rendering the contents of a slot into multiple places inside of a webcomponent
The Problem
I am using Angular and its Angular Elements to generate Webcomponents. I want clients to be able to pass these webcomponents icons into slots, so that the client can determine what the ...
0
votes
1
answer
702
views
Error: Property '"url"' is incompatible with index signature. Type '{ alias: "axLazyElement"; required: false; }' is not assignable to type 'string'
Facing this error while using @angular-extensions/elements for lazy loading of angular element
I tried using in the component like below:
<mwc-button *axLazyElement="url; loading: loading; ...
1
vote
0
answers
278
views
Which is better for micro frontend in Angular besides module federation, using IFrames or Angular elements?
We are looking to separate a feature in our existing main Angular application. We are considering using IFrames or web components using Angular elements. Module federation is currently not an option ...
0
votes
1
answer
223
views
Passing object variable as @input to an angular custom element and bind a method for the @output event while adding the web element to summernote
I have been using ngx-summernote as my rich text editor. Now, for my project purpose, i will need to insert out custom angular component dynamically to the rich text editor. After analysis, i found ...
1
vote
0
answers
392
views
How to build SPFX Web Part with Angular CLI Elements
When using gulp serve - Getting errors like
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
I am trying to follow
https://www....
2
votes
0
answers
197
views
Preventing host page styling leaking into Angular Elements web component
Briefly:
I created an Angular Elements web component in Angular 15
I have ViewEncapsulation.Emulated set for the component (for some reason, ViewEncapsulation.ShadowDom doesn't work - it breaks some ...
3
votes
0
answers
349
views
Angular Elements using ngx-build-plus and npm publish
I am trying to build an app that:
contains angular elements
publish this app in npm as a library
Install the library in a different angular application
use the custom element created in this new ...
3
votes
1
answer
7k
views
keycloak-angular with AngularElements and Standalone Component (no Authorization Header added to requests)
I have an angular app (and a nestjs backend) and I try to handle user login with the help of keycloak. As the buzzword rich question title states I have kind of a "weird" architecture.
I ...
3
votes
1
answer
1k
views
How to authenticate external web components with API calls
I've been tasked with creating a suite of web components to share with customers to consume into their websites. I've come across the idea of Angular Elements, and this looks interesting, but I'm not ...
1
vote
2
answers
2k
views
Angular Element - Custom web component - bundle
I have developed a custom web component that I am using in a Chrome Extension (Content). This Angular web component worked fine in Angular 12. I bundled all the scripts and loaded them in various web ...
0
votes
0
answers
201
views
How to stop host CSS bleeding into web component with angular elements
Currently I am working on a specialized web component built with angular elements, where I have some dependencies to prime ng and primeflex library, due to this I cannot enable ViewEncapsulation....
1
vote
1
answer
669
views
Giving error in chrome like cannot read properties of undefined in Angular
Created two web components: web-comp-1, web-comp-2
When I tried to add in HTML page, I am getting console error like below
Uncaught TypeError: Cannot read properties of undefined (reading 'create')
at ...
0
votes
1
answer
575
views
Angular Elements: Get a reference to host web component element
When using Angular Elements, we'd usually have something like this to build an app as a web component:
export class AppModule implements DoBootstrap {
ngDoBootstrap(appRef: ApplicationRef): void {...
1
vote
2
answers
537
views
Package Angular into Library
I've searched around and haven't quite figured out how to do this yet.
I have an Angular library I've created that contains custom components. This is being exported as Web Components so other ...
1
vote
1
answer
2k
views
Unit tests of Angular Elements (registered with the CustomElementRegistry as a HTML Custom Element) pass individually but fail when run together
I'm using Angular Elements https://angular.io/guide/elements which allows me to create an angular component, define a tag name, and register it as a HTML Custom Element in the CustomElementRegistry ...
0
votes
1
answer
769
views
send param to Angular Element from Master App (Micro FrontEnd)
i make a small angular application and convert it into angular element to use it as a micro frontend in other master App and it looks great and works fine.
but I need to pass a value from Master App ...
0
votes
1
answer
909
views
Angular Elements does not work with Primeng
Description
I'm trying to create an Angular Elements using Primeng components. When I run the Angular app everything works just fine. However, once I build and use my Angular Elements containing my ...
0
votes
0
answers
508
views
Angular web component directive its not working
I am trying to convert angular components to angular web component, I followed few articles to do it which is good, but when I tried to convert angular directive as web component it throws some error ...
2
votes
1
answer
699
views
How to pass Angular directive by reference?
In an existing component template I have this (simplified) element:
<input type="button" #refreshPrice />
This is picked up (I don't know the correct term) by this property so we can ...
0
votes
1
answer
329
views
Emitted number from Angular Element turns into string when reaching javascript event listener
I have created a web component in Angular Elements which defines and emits events like this:
@Input() groupId: number = -1;
@Output('group_change') groupChange!: EventEmitter<number>;
...
this....
5
votes
1
answer
4k
views
Bundling Angular Element into a Single File
I am building a Web Component with Angular Element (version 13) and I have a question regarding bundling.
Would it be possible to the build the Web Component in a way that all of the js bundles (main....
1
vote
1
answer
2k
views
NullInjectorError while creating simple custom element (@angular/elements). without any providers, services
Lately I have been learning Angular and @angular/elements.
I was curious about creating custom element that i can use in any html.
My goal is to create simple custom element just with 1 component ...
2
votes
1
answer
632
views
Get Element Reference of a DOM Element created dynamically from a library
I want to add a class to a DOM Element by taking it's reference. But the element is created by a library and I cannot access it directly, means I can't use ViewChild or HostBinding on that DOM Element....
4
votes
0
answers
999
views
Difference between Angular Module Federation and Angular Elements
Can anyone explain to me the difference between Angular Module Federation and Angular Elements? I am new to Angular and my understanding so far is that both are two ways to provide shared Web ...
3
votes
1
answer
6k
views
Reset Angular router state in webcomponent (angular elements)
I have a simple microfrontend scenario that loads and embeds an angular 13 webcomponent (created with angular elements) in a container webapp.
Basically, the routing works fine. When leaving the route,...