1

I have a problem importing my libraries. I import my project like this into another project:

<app-root></app-root>
        <script type="text/javascript" src="/etc/chat/inline.bundle.js"></script>
        <script type="text/javascript" src="/etc/chat/polyfills.bundle.js"></script>
        <script type="text/javascript" src="/etc/chat/styles.bundle.js"></script>

There are 2 libraries with the same function name: forEach (collection, iteratee).

This overwrites the function I want to use. How can I do ? Knowing that I can not change the order of the libraries.

Floriane
  • 315
  • 6
  • 20
  • Check this solution: https://stackoverflow.com/questions/2975793/how-to-deal-with-conflicting-function-names-in-javascript-if-functions-are-from – Isma Aug 23 '17 at 14:11
  • Yes but I can't modify thre script. – Floriane Aug 23 '17 at 14:49
  • You don't need to modify it, just import one, save the function that you want to keep under a different name, then import the second one which will override the first function (but you don't care because you saved it under a different name). – Isma Aug 23 '17 at 14:57
  • Yes, but I do not see how to do it because I import all my libraries in one line, like this: ` ` – Floriane Aug 23 '17 at 15:07
  • Then may be there is a bug in the script. Is it a known library or something you have done yourself? – Isma Aug 23 '17 at 15:09
  • No, it's two known libraries. The function I want to use is in typescript.js and the one I do not want to use is in lodash.js – Floriane Aug 23 '17 at 15:11
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/152652/discussion-between-isma-c-and-floriane). – Isma Aug 23 '17 at 15:12

1 Answers1

0

posting for other people asking, this thread provides the solution:

Load external library from CDN under an alias

lorenzo
  • 397
  • 4
  • 16