We have an Angular 4 app built with angular-cli. Instead of using the auto-generated index.html
we want to distribute it as a plugin / widget which customers can import on their page. Similarly like disqus comments work,...
With the previous version built in AngularJS, the customer just had to include one CSS and JS file and the application tag.
This issue is similar to Using Angular 2 components in static & non-SPA web applications However there isn't really a working solution described.
Here is what I have so far:
- defined
deployUrl
in.angular-cli.json
- extract list of js + css files to be included in the new html file
- Add the files in the html file similarly like it was in the auto-generated
index.html
The problem is I'm getting a Uncaught ReferenceError: webpackJsonp is not defined
as described in https://github.com/angular/angular-cli/issues/2211.
I could of course include it via iframe, but that would make integration and custom styling more difficult.
So what are the best options to take an Angular app and somehow make it reusable on other HTML pages?