Not so long ago, I began to study angular, and in the course of studying I had an idea to create a user script containing an application that should be displayed on a specific page of a third-party site. The page itself does not use angular, and I need, for example, to replace the usual html-form on it with an interface with support for ajax. The problem is that the changes on the page must be done after it is loaded. If I used simple JS, I would do something like this:
document.querySelectorAll('#element')[0].innerHTML = 'Мой_код_формы' But what about angular? I have studied the information about dynamic components, but the problem is that they can be added only to other components, while the loaded page itself is not a component. Therefore, I cannot add any component to the page using ViewContainerRef.
Ideally, I need to create a service that creates the necessary component right in the right place in the raw DOM (for example, in the DIV with the necessary id), since many different components are planned. Is there such a possibility in principle, and if so, how to do it?
@angular/(core|common)and compiled components / pipes / directives, it follows the question whether you need it? - overthesanity@angular/elements, but very raw still - overthesanity@angular/elementscan solve your problem - overthesanity February