Angular 5 share components between different domains

695 views
Skip to first unread message

Pan

unread,
Dec 13, 2017, 10:07:51 PM12/13/17
to Angular and AngularJS discussion
I want to ask if there is a way to share angular components between different domains. For example I have 2 web servers running on different domains(domain-name-1.com, domain-name-2.com).
I want to use an angular component from domain-name-1 into domain-name-2 (something like an IFrame, but I don't want to use it). From what I have read this is not possible correct?
Basically I want to have one main page containing different modules (like product search, product details, product info e.t.c) and this modules to be served independently by other domains
It's there any other way to reference angular components between different origins?

Thanks in advance

Sander Elias

unread,
Dec 13, 2017, 10:41:02 PM12/13/17
to Angular and AngularJS discussion
Hi Pan,

You can reuse components between projects, but if I understand correctly you want to load a part of your angular app from a different domain? You mean like dynamically loading parts of your application. But those parts are not in the code-base of the app you are currently in?
This is possible now, but it's not an easy straightforward process. However, somewhere in 2018 Angular Elements will come to life, and it will make this not only possible but also easy.

Regards
Sander

Pan

unread,
Dec 14, 2017, 1:40:29 AM12/14/17
to Angular and AngularJS discussion
Yes you understand correct Sander. Thanks for the reply

Allan Fagner

unread,
Apr 11, 2018, 11:07:28 AM4/11/18
to Angular and AngularJS discussion
Hi Pan and Sander,

I need to do exactly what you two are discussing in this thread. So, could either of you let me know where I can find some reference/docs/source code about how to load components from different domains?

I checked Angular elements but it seems it was not officially released yet. If it was not, is it stable enough to be used in a production enviroment?

Sorry for bringing up an old thread

Thanks

Sander Elias

unread,
Apr 11, 2018, 1:05:54 PM4/11/18
to Angular and AngularJS discussion
Hi Allan,

Angular Elements will hit experimental in V6, and probably production ready in V7 (although it still will be experimental by then, just more stable!)
With the current release cadence, that would mean it should be usable end of the year. 
If you don't mind coping with small breaking issues, and some additional manual tooling, well take a look at it now. The next iteration of the angular.io site will be built around AE. So, production ready is in the eye of the beholder ;)

Regards
Sander 

Arun prasath

unread,
Apr 19, 2018, 7:57:46 AM4/19/18
to Angular and AngularJS discussion
hi sir I am from india .

I am new to angular 5 and don't know how to connect MySQL with it . could you help me with it ! sir  
Reply all
Reply to author
Forward
0 new messages