Open DanielNetzeriAm opened 6 years ago
Faced the same issue, I wanted to dynamically load js file with compiled angular elements and append it to the body. It looks like some plugin architecture when users can extend basic functionality by adding custom elements at runtime.
But looks like this approach won't work in angular app because when you add js with elements it already has polyfills and other angular dependencies which can conflict with an existing app. For example, in Anguar v6 when load this script you get an error Zone already loaded
.
in general the polyfills are problematic with IE.11 and firefox.
When I try to add the script to .angular-cli, at the index.html or at main.ts there is an error
Uncaught TypeError: (intermediate value)(intermediate value).push is not a function at Object.eval (omega.js:1) at eval (omega.js:4) at Object../src/assets/scripts/omega.js (main.bundle.js:1206) at __webpack_require__ (inline.bundle.js:55) at eval (main.ts:8) at Object../src/main.ts (main.bundle.js:1222) at __webpack_require__ (inline.bundle.js:55) at Object.0 (main.bundle.js:1230) at __webpack_require__ (inline.bundle.js:55) at webpackJsonpCallback (inline.bundle.js:26)
coming from the first line of the compiled code
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{0:function(e,
any idea how to solve this? or how to use a custom element in an angular project?