Angular 2: loading an external javascript file that requires variables -
here's example of embed code required fora video service (i've simplified considerably because details don't matter):
<script> https://videothingexample.com/partner_id/123? entry_id=0_12345&playerid=default_player </script>
it appears above url dynamically generates javascript (via php?) , returns passed variables (entry_id
example) included directly script itself.
that is, every embedded player requires own script , have assume there unlimited players, loading scripts in .angular-cli.json isn't possible.
my first instinct thrown <script>
tags view, that's frowned upon angular scrub script tags out
it's apparently possible use dom sanitizer end-runs, i'm wondering if that's necessary.
what best practice including dynamically generated js this?
Comments
Post a Comment