Download the Angular 2 app, side by side with the Angularjs app already loaded

There is an Angularjs app on a specific website that I do not control. It loads in HTML when I open the page. Let me call it app 1 :

<body data-ng-app="app1">.....</body>

My chrome plugin adds the websites I visit to the HTML pages, the Angular 2 app . Name this app 2 . I usually embed it with this code:

$('body').append('<app-root id="app-root"></app-root>');
platformBrowserDynamic().bootstrapModule(AppModule);

But that will not work.

==> The problem is that Angularjs " application 1 " is located directly in the body. So, how do I add side by side in Angleular 2 “ app 2 ”?

+4
1

, ( angular 2 chrome)

$('html').append('<app-root id="app-root"></app-root>');
platformBrowserDynamic().bootstrapModule(AppModule);

div insertAdjacentHTML body afterbegin https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML

+2

Source: https://habr.com/ru/post/1689851/


All Articles